Delay and JCouple

Between pulses the spins evolve on their own. Delay is the chemical-shift part of that evolution, JCouple the scalar-coupling part. Both are exact unitaries, so a programme built from them is a circuit with the same state as the physics.

Delay(t, offset, wires...)

ParameterTypeDefaultMeaning
tfloat0.001Duration in seconds.
offsetfloat0Resonance offset from the carrier in hertz.
...wires0Spins that precess. Each listed spin gets the same offset.

Free precession is a rotation about z by 2π·offset·t radians. In Qubi's multiples of π that is 2 * offset * t, so the body of the function is one line: RZ (w) ang. A delay of 1/offset is a full turn; 1/(4·offset) is a quarter turn.

Pulse(90, "x", 0)
Delay(0.001, 250, 0)     // 2π · 250 · 0.001 = π/2: a quarter turn about z
Delay(0.004, 250, 0)     // a full turn: back where it started

Spins with different offsets need separate calls, one per spin. Nothing relaxes during a delay in the circuit model; T1 and T2 only shape the lines on the NMR tab.

JCouple(t, J, a, b)

ParameterTypeDefaultMeaning
tfloat0.001Duration in seconds.
Jfloat215Scalar coupling constant in hertz.
a, bwires0, 1The two coupled spins. Exactly two are required.

The weak-coupling Hamiltonian 2πJ IzSz evolves for t seconds into exp(−iπJt Z⊗Z/2). The library builds that as CX [a,b], RZ b by Jt (multiples of π), CX [a,b], which is the standard decomposition of a ZZ rotation. Two durations matter more than any other:

DurationEffect
1 / (2J)Transverse magnetisation of either spin becomes antiphase with respect to the other: the two doublet components point opposite ways. This is the state every polarisation transfer and every NMR CNOT passes through.
1 / JA full period. The pair is back in phase up to a Z on each spin.
Pulse(90, "y", 0, 1)              // both spins transverse
JCouple(1 / (2 * 215), 215, 0, 1) // antiphase after 2.33 ms
Readout(0, 1)

Only a partner in a superposition of |0⟩ and |1⟩ shows both doublet components. With the partner in a pure |0⟩ the evolution is just a z rotation of the other spin by J/2, which is the +J/2 line of its doublet on its own.

Shift and coupling together

A real delay does both at once: chemical shift on each spin and coupling between them. Because the two terms commute, Delay on each spin followed by JCouple on the pair for the same time is the exact evolution. To keep the coupling and lose the shift, put a 180° pulse on both spins in the middle, which is what SpinEcho does and what every two-qubit gate on an NMR computer relies on.

// 2 ms of real evolution: 100 Hz and 40 Hz offsets, J = 7 Hz
Delay(0.002, 100, 0)
Delay(0.002, 40, 1)
JCouple(0.002, 7, 0, 1)

Passing values on

Inside your own functions, wrap classical arguments in (float) when handing them to Delay or JCouple: Delay((float)tau, (float)offset, w). A bare variable holding 0 or another small integer is read as a wire list otherwise.

See also

sequences that use both.