northwestern

SpinQube

Spin physics you can turn knobs on

Spin physics simulation in a box. It runs in your browser: pick a spin system, change a number, and the energy levels, spectra, pulse sequences and gates update as you go.

Build a pulse sequence on two coupled spinsdensity matrix, exact

Click a pulse or a delay and it is drawn into the sequence above. Play it, or walk it one step at a time. Switch spin B off for a single spin. The detect box draws the real recorded signal; click it to jump to the full trace. This panel works in the density matrix: it starts from thermal equilibrium, a mixed state, and carries T₁ and T₂, which is why the signal decays. The gate panel starts from the pure state |00⟩ and applies unitaries only, the state-vector picture. The ready-made sequences below include the Hadamard and the CNOT of that panel written out as the pulses that produce them.

Apply to
Pulses
Delays and detection
Sequence — click a step to remove it
Ready-made pulse sequences
Spin A
Spin B

Stage
A in phase
A antiphase
B in phase
Time
Spin system and coupling
Build a gate circuit on the same two spinsexact unitaries

The same two spins and the same spheres. When the pair becomes entangled both arrows shrink to the centre: each spin alone is then undetermined while the pair stays pure.

Apply to
Single-qubit gates

The X gate flips the qubit. The Y gate flips it and turns the phase by 180°. The Z gate changes the sign of |1⟩. The Hadamard gate H takes a pole to the equator. The S and T gates add a quarter and an eighth turn of phase. The √X gate is a 90° x pulse, so two of them make an X.

Two-qubit gates and free evolution

The CNOT gate flips the target when the control is |1⟩. The CZ gate changes the sign of |11⟩ only. The SWAP gate exchanges the two qubits, the √SWAP gate does half of it, and the iSWAP gate adds a quarter turn of phase on the way. The delays are free evolution under the coupling itself.

Sequence — click a step to remove it
Ready-made circuits
Qubit A
Qubit B

Stage
Arrow length
Entanglement
Purity of the pair
Spin system and coupling
Periodic table of magnetic isotopesspin, γ, abundance

Nuclear spins

Click an element. Cells carrying a magnetic isotope are filled; the small line shows its mass number and spin.

Protein chemical shifts

Shifts of a protein can be predicted from its structure with PPM_One. The program is run by its authors on a server at Ohio State. This box links to that server and does not run anything on this page.

  1. Add hydrogens to your PDB file, because PPM_One needs them. Add them in Chimera, not PyMOL: Chimera names the hydrogens the way PPM_One requires.
  2. Open the server, enter your name and institute (the page says these are used only for its usage statistics), and upload the PDB file.
  3. Choose the model: PPM for an ensemble of structures, or the ANN or linear model of PPM_One for a single static structure. Experimental shifts in NMR-STAR 2.1 or 3.1 format can be uploaded as well.

Open the PPM server at Ohio State ↗

The file you upload goes to the Ohio State server, not to this site. References: Li and Brüschweiler, J. Biomol. NMR 62, 403–409 (2015) for PPM_One, and J. Biomol. NMR 54, 257–265 (2012) for PPM.

Paramagnetic species

Electron spins, kept separate from the nuclear table on the left. Pick a species to load representative values, then change anything you like — the spectrum is recomputed from the numbers in the boxes, not from the preset. An element underlined in orange on the left forms a common paramagnetic species — an oxidation state of the ion, or a radical centred on that atom. Click it and its species appear here; where an element has several, they are listed side by side so the closed-shell ones are visible as such.

g isotropic
Centre field at that g
A∥ in field units
Resonances found

Powder average over orientations, exact diagonalisation of the electron spin Hamiltonian at every field. Tensors are taken axial and collinear and the hyperfine of one nucleus is applied to first order, so this is a teaching-grade spectrum: good for shape and spacing, not a substitute for a least-squares fit.

Thermal spin polarizationinstant, no download

Boltzmann polarization of a spin I in a field: P = BI(γℏB / kBT), the Brillouin function, which for I = ½ is tanh(γℏB / 2kBT).

Polarization
in ppm
Larmor frequency
Relative to 1H
γℏB / kBT

Curves:

Polarization against temperature at the field above, log scales.

Energy levels: triplet, or radical pair with exchange and dipolar couplingexact diagonalisation, no approximation

The spin Hamiltonian is diagonalised exactly at every field, with no secular or high-field approximation:
H = D(Sz2 − 2/3) + E(Sx2 − Sy2) + gμB(BxSx + BzSz)
D and E are the axial and rhombic zero-field parameters in MHz and the field lies in the xz plane at θ from z. At B = 0 the levels sit at −2D/3, D/3 − E and D/3 + E. The levels bend wherever the field is not along the D axis; at θ = 0 with E = 0 they are exactly straight, which is the right answer, not a stuck plot. Enter D directly: the conversion from a point-dipole distance differs by a factor of two between conventions, so it is deliberately not done for you.

Zero field, 1→2
Zero field, 1→3
Zero field, 2→3
At the marker, 1→2
At the marker, 2→3

The levels against field. The dashed line is the marker.

Dipolar coupling, Pake pattern and distance distributioninstant, no download

The full dipolar Hamiltonian, used untruncated

H = g1μBB0S1z + g2μBB0S2z + d [ S1·S2 − 3 (n·S1)(n·S2) ]

n is the unit vector along the spin–spin axis, at θ to the field. This 4×4 is diagonalised numerically at every orientation and every distance below. Nothing is truncated: the flip–flop and the pseudo-secular terms are all kept, so the panel stays correct when the coupling is no longer small against the Zeeman splitting.

The two couplings, which are not the same number. d is the dipolar coupling constant, the whole orientation-independent strength that multiplies the bracket: d = 52.0410 MHz nm3 × g1g2/ge2 / r3, equivalently 52040 MHz Å3/r3. D(θ) = d (1 − 3cos2θ)/2 is only the secular part — what survives truncation at high field. At θ = 90°, D⊥ = d/2, and the doublet splitting 2|D| equals d. The dipolar interaction has no isotropic part: averaged over all orientations it is exactly zero.

Type a distance or a coupling and the other follows. Drag θ fully left for a powder average, otherwise a single orientation.

Coupling constant d6.51 MHz
Dipolar period 1/d154 ns
Secular D(θ)—
Secular splitting 2|D|—
Exact splitting, diagonalised—
Departure from secular—
Parallel edge 2d13.01 MHz
Full Pake breadth 3d19.52 MHz
Magic angle54.7°
Powder-averaged dipolar evolution, as measured by DEER.
Pake pattern — the spectrum of the trace above.
A single distance.
Pulse sequences on three channelsdensity matrix, 8 spin states

Two electrons and one coupled nucleus. Channel 1 pulses the observer electron, channel 2 the partner, channel 3 the nucleus. Switch a channel off and its pulses are removed from the sequence — the quickest way to see what each one does. The density matrix is propagated through the pulses and delays exactly; relaxation is phenomenological, with T1 and T2 as you set them.

Channels

The sequence. A greyed channel is switched off.
NMR spectrum of a coupled spin systemruns Spynach in your browser

This runs Spynach, Alexej Jerschow’s Python reimplementation of the Spinach spin-dynamics kernel (Ilya Kuprov), both MIT licensed. The package is fetched from PyPI and run in your browser; nothing is sent to a server. The first run downloads the Python runtime, about 20 MB.

Licence
MIT License

Copyright (c) 2026 Alexej Jerschow

Spynach is a Python reimplementation of the Spinach spin dynamics kernel
(https://spindynamics.org). This licence derives from the Spinach MIT
licence of Ilya Kuprov (see below).

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


Spinach
=======

The sources, tests, molecule data, isotope table, spherical grids and
example scripts of Spynach were written by reading and translating Spinach. Spinach is distributed under the MIT License with the following
notice, which is reproduced here as that licence requires and must be kept
with any copy or substantial portion of this software.

Copyright (c) 2005-2025 ILYA KUPROV

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


EasySpin
========

The `easyspyn` package (src/easyspyn), its tests and its isotope table were
written by reading and translating EasySpin (https://easyspin.org), which
is distributed under the MIT License with the following notice, reproduced
here as that licence requires and to be kept with any copy or substantial
portion of this software.

Copyright (c) 2006-2024 Stefan Stoll and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Use of AI in the translation
============================

The translation of Spinach from MATLAB to Python was carried out largely by
an AI coding agent (Claude, Anthropic) working under the direction of
Alexej Jerschow, who set the goals, reviewed the results and holds the
copyright above. Commits made by the agent are marked as such in the git
history. Correctness rests on the test suite, which compares Spynach with
reference data computed by Spinach, not on the method of authorship.

The Python being run — edit it and press Run

Changing a control above rewrites this box. Edit freely; anything Spynach can do will work here.

Draw a molecule to get hints for its NMR or EPR spectrumstart here

Type a SMILES string and RDKit draws the structure in your browser. The three cards under the drawing turn the molecule into hints: which of its nuclei NMR can see, where to get predicted chemical shifts, and whether it can give an EPR spectrum, with a one-click start in the EPR panel. The drawing downloads as SVG, which stays sharp at any size, or as PNG. RDKit is downloaded the first time this panel is opened, about 7 MB.

What a SMILES string is, and how to type one

A SMILES string is a line of text that describes a molecule. Letters are atoms, symbols are bonds, and brackets show how the pieces connect. A molecule can be written in several ways and RDKit draws the same structure from each.

  • Atoms are element symbols: C, N, O, S, P, F, Cl, Br, I. Hydrogens are left out and filled in automatically, so CCO is ethanol.
  • Bonds: neighbouring atoms are joined by a single bond. Use = for a double bond and # for a triple bond.
  • Branches go in parentheses. In CC(=O)O, acetic acid, the =O hangs off the second carbon.
  • Rings: a digit marks where a ring closes, so C1CCCCC1 is cyclohexane. Lowercase letters are aromatic atoms: c1ccccc1 is benzene.
  • Square brackets hold charges, isotopes, explicit hydrogens and radicals: [NH4+] is ammonium, [17OH2] is water with oxygen-17, and the [O] in TEMPOL, N1[O], is an oxygen with an unpaired electron.
  • Handedness: @ and @@ mark the direction around a stereocentre. N[C@@H](CS)C(=O)O is L-cysteine.
  • Typing: capitals matter (Cl is chlorine, CL is an error). Leave out spaces: RDKit stops reading at the first space, so C C O draws methane.

To get a SMILES string for a compound you already know, look it up on its PubChem page, or copy the structure from ChemDraw as SMILES. Click any example above to load it into the box.

Where will the lines fall? Predicted NMR shifts

RDKit does not predict chemical shifts. COLMARppm does, for 1H and 13C of organic molecules, with the SMILES string as the only input. It is run by the Brüschweiler group at Ohio State, who also made PPM_One.

Copy the SMILES, open the COLMAR page and choose COLMARppm in its menu. Then type the predicted shifts and couplings into the NMR spectrum panel further down this page.

Open COLMAR at Ohio State ↗

The prediction runs on their server, so your SMILES goes to Ohio State when you paste it there. Nothing is sent from this page.

Can it give an EPR spectrum?

EPR needs an unpaired electron. RDKit reads unpaired electrons from the SMILES, for example the oxygen written [O] in a nitroxide. This card names the radical type and the nuclei beside it, and starts the EPR panel from the matching preset.

Which nuclei can NMR see?

NMR sees only nuclei with a magnetic moment, that is, spin above zero. Each row is such a nucleus in your molecule. A low natural abundance means a weak signal unless the sample is enriched, which is why 1H is easy and 17O is hard. Frequencies are γB0/2π for the bare nucleus; a spectrometer’s reference frequency differs from them by up to a few hundred ppm (about 400 ppm for 17O).

Licence
RDKit (https://www.rdkit.org), distributed here as the RDKit.js WebAssembly build,
@rdkit/rdkit 2026.9.2 (https://www.npmjs.com/package/@rdkit/rdkit), licence BSD-3-Clause.
The licence below is RDKit's own (https://github.com/rdkit/rdkit/blob/master/license.txt).

BSD 3-Clause License

Copyright (c) 2006-2015, Rational Discovery LLC, Greg Landrum, and Julie Penzotti and others
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
   contributors may be used to endorse or promote products derived from
   this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Going further with Spynach

Spynach and EasySpyn rest on the work of two other groups. Spinach, the spin-dynamics library, is the work of Ilya Kuprov and co-workers (spindynamics.org). EasySpin, the EPR simulation package, is the work of Stefan Stoll and co-workers (easyspin.org). Both were written in MATLAB. Alexej Jerschow’s project translates them to Python: Spynach (also on PyPI) is the port of Spinach, and EasySpyn is the port of EasySpin. The same repository holds ctps, Jerschow’s own coherence-pathway code. As the project states, the translation was done largely by an AI coding agent working under Jerschow’s direction, and correctness rests on test suites against the reference data of the originals (Spinach 2.13 and EasySpin 6.0.15). Spynach, Spinach and EasySpin are all MIT licensed. The project’s credit tables name the people behind each translated function, for Spinach and for EasySpin. The browser playground is by Moritz Zaiss, and the relaxation-pathway module by Florin Teleanu.

What on this page comes from Spynach

Two things. The NMR spectrum panel above runs Spynach in your browser. The question trees at right take their code, parameters and descriptions from the examples of the Spynach playground; the trees show that code and link to the playground, and do not run it. Nothing else here uses Spynach, EasySpin or EasySpyn. The periodic table and the polarization, dipolar, triplet and EPR panels are written from scratch for this site, and the EPR panel in particular is a small hand-written powder simulation with its limits stated on the panel. The molecule panel is drawn by RDKit.

How to go further

The browser version handles a few spins, and larger systems belong in a local install (Python 3.11 or newer):

pip install spynach    # NMR
pip install easyspyn   # EPR

Paste a script from the NMR panel’s code box or from a tree leaf into Python. It is ordinary Spynach input, not a web-only dialect. The project’s guides start with the Hilbert-space guide, and each guide has a runnable notebook. Coming from Spinach and Coming from EasySpin list what carries over from the originals and what differs. For what Spynach can do, and how far it has been checked against the originals, read the project’s own pages: the repository and ajerschow.github.io/spynach.

When Spynach is the right tool

The panels on this page answer questions that have a closed form: one coupling, one spectrum, one set of energy levels. Spynach is for the ones that do not. Use it when the full density matrix has to be propagated through a real pulse sequence, when there are more spins than a formula can carry, when relaxation needs treating properly rather than as a decay constant, or when the lineshape depends on exchange or motion. It also makes a result checkable, since it reimplements kernels that have been tested for years and any answer can be compared against the original.

New to Spynach? Start here

Pick what you want to simulate. Each path ends in a ready example: the function to use, why it fits, code with numbers you can change, and a link that runs the same example in the Spynach playground in your browser, with nothing to install. When you want to run it yourself, the steps under the questions show how. The code and the parameter descriptions are from the Spynach playground examples (MIT licence).

NMR

EPR

Then run it yourself

The examples above can run in the playground with nothing to install. To use Spynach on your own spin system, run it in a notebook in the cloud or on your own computer.

  1. Choose where to run it. With nothing to install: open a quick-start notebook in Google Colab, NMR or EPR, or use the playground. On your own computer you need Python 3.11 or newer; check with python --version in a terminal.
  2. Install. In the terminal, type pip install spynach matplotlib for NMR, or pip install easyspyn matplotlib for EPR. The matplotlib package draws the plots and is not part of Spynach.
  3. Run a first script. Copy a script below into a file, for example first_nmr.py, and run python first_nmr.py. A window opens with the spectrum.

    NMR: two coupled protons

    EPR: a nitroxide in a frozen solution

    The scripts in the questions above print numbers and draw nothing. To plot one of them, add plotting lines like the ones at the end of these scripts, using the arrays that the example computes.
  4. Change one number and run it again. In the NMR script, set J = 40.0: the two outer lines shrink and the two inner lines grow, the leaning of an AB pattern. In the EPR script, lower the third value of A from 86 to 60 and the whole spectrum narrows.
  5. Use your own system. Replace the isotopes, shifts and couplings, or the g values and hyperfine couplings, with your own numbers. The questions above show which function fits other problems, and the molecule panel lists the NMR-active isotopes of a molecule you draw.
  6. Read on. The project’s guides start with the Hilbert-space guide for NMR, and the EPR simulators have their own guide, EPR simulations with EasySpyn. Each guide has a notebook you can run.