Stim Files 2021 🔥
, a high-performance library for simulating stabilizer circuits. Always encoded in and consists of a series of instruction lines. Structure: Instructions: Each line contains an operation (e.g., ) followed by target qubits. Use the hash symbol ( ) to add non-semantic notes. Annotations: OBSERVABLE_INCLUDE to define how errors should be tracked for decoding. Getting Started: Install the library via pip install stim Write your circuit in a text editor and save it with the extension.
The BIDS standard has revolutionized how stim files are organized. Instead of proprietary formats, BIDS uses .tsv (tab-separated values) files to store events.
graph TD A[Encounter a .stim file] --> BIdentify context; B -- "Neurostimulation / EEG" --> C[Section 1: Neuroelectrics .stim Format]; B -- "Neural Network Simulation (Auryn)" --> D[Section 3: Auryn Simulator]; B -- "Quantum Computing" --> E[Section 2: Quantum Computing Stim]; B -- "fMRI / Psychology Experiment" --> FSections 4 & 5: Paradigm / PRT Files; C --> G[Open with NIC or convert to .csv]; D --> H[Open with text editor or Gnuplot]; E --> I[Use Stim Python library]; F --> J[Open in BrainVoyager / FreeSurfer];
★★★★☆ (4.5/5) – Loses half a star only due to lack of native hierarchical support and validation. stim files
If you are working on fMRI data analysis and need to ensure your timing files are correctly formatted for AFNI, I can provide a Python script to convert experimental logs into the appropriate 1D format.
The academic community has pushed for interoperability. Modern research stim files are often written in human-readable formats like or XML with a schema like "Neurostimulation Markup Language (NSML)." An example snippet might look like:
| Format | Structure | Best for | Worst for | |--------|-----------|----------|------------| | | Flat table | Factorial designs, simple sequences | Adaptive procedures, real‑time condition branching | | JSON / YAML | Nested hierarchy | Complex block designs, metadata‑rich stimuli | Manual editing (error‑prone) | | MATLAB .mat / Python pickle | Binary | Speed, large arrays | Portability, version control | | Hard‑coded in script | Programmatic | Adaptive psychophysics (e.g., QUEST) | Reproducibility, collaborative editing | Use the hash symbol ( ) to add non-semantic notes
Best-practice STIM files are heavily commented. Since neural data can be re-analyzed years later, researchers embed notes regarding the physiological goal (e.g., "Attempting to evoke whisker twitch" or "High-frequency blockade of thalamic burst" ).
In a standard "task-based" fMRI experiment, the brain is constantly active. To find the specific "signal" related to a task, researchers must "model" the expected brain response.
[ STIM File ] ---> [ Convolved with HRF ] ---> [ Statistical Regressor ] (Raw Timings) (Hemodynamic Model) (Predictive Waveform) The BIDS standard has revolutionized how stim files
This simple format allows the activation of different neuron groups at precise times, which is crucial for studying learning and plasticity in neural networks.
These are simple text files, often used in AFNI for fMRI analysis ( afni_proc.py ). They list the onset times of events.
While no universal standard exists, most stim files share a common row‑based, column‑delimited structure (e.g., tab‑separated or comma‑separated values). A representative example (visual search task):