mimiqcircuits.operations.magic¶
Magic-state preparation.
Classes
alias of |
|
Prepare one qubit in the magic state. |
- class mimiqcircuits.operations.magic.PrepareStateT[source]¶
Bases:
krauschannelPrepare one qubit in the magic state.
Prepares the magic state \(T\ket{+} = (\ket{0} + e^{i\pi/4}\ket{1})/\sqrt{2}\), whatever the previous state of the qubit.
A magic state is the resource consumed by a \(\pi/8\) Pauli rotation when the rotation is carried out with Pauli product measurements (see
pauli_based_computation()). Fault-tolerant architectures produce these states separately, by distillation, so a dedicated operation lets them be counted and scheduled.The operation is a Kraus channel with operators \(T\ket{+}\bra{0}\) and \(T\ket{+}\bra{1}\), and is equivalent to
Reset,GateH,GateT. It cannot be inverted, raised to a power or controlled.Examples
>>> from mimiqcircuits import * >>> PrepareStateT() PrepareStateT >>> c = Circuit() >>> c.push(PrepareStateT(), 0) 1-qubit circuit with 1 instruction: └── PrepareStateT @ q[0]
The decomposition resets the qubit to \(\ket{0}\), then applies
HandT:>>> PrepareStateT().decompose() 1-qubit circuit with 3 instructions: ├── Reset @ q[0] ├── H @ q[0] └── T @ q[0]
See also
Reset,ResetX,MeasurePauli
- mimiqcircuits.operations.magic.PrepareMagic¶
alias of
PrepareStateT