mimiqcircuits.operations.measurereset¶
Measure and reset operations.
Classes
MeasureReset operation. |
|
MeasureResetX operation. |
|
MeasureResetY operation. |
|
This class acting as an alias for |
- class mimiqcircuits.operations.measurereset.MeasureReset[source]¶
Bases:
AbstractMeasurementMeasureReset operation.
This operation measures a qubit q, stores the value in a classical bit c, then applies a X operation to the qubit if the measured value is 1, effectively resetting the qubit to the \(\ket{0}\) state.
Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(MeasureReset(), 1, 0) 2-qubit, 1-bit circuit with 1 instruction: └── MR @ q[1], c[0] >>> c.decompose() 2-qubit, 1-bit circuit with 1 instruction: └── MR @ q[1], c[0]
- class mimiqcircuits.operations.measurereset.MeasureResetX[source]¶
Bases:
AbstractMeasurementMeasureResetX operation.
The MeasureResetX operation first applies a Hadamard gate (H) to the qubit, performs a measurement and reset operation similar to the MeasureReset operation, and then applies another Hadamard gate. This sequence effectively measures the qubit in the X-basis and resets it to the \(|+>\) state.
See also
MeasureReset: The standard measurement and reset operation in the Z-basis.MeasureResetY: Similar operation that measures and resets the qubit in the Y-basis.Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(MeasureResetX(), 1, 0) 2-qubit, 1-bit circuit with 1 instruction: └── MRX @ q[1], c[0] >>> c.decompose() 2-qubit, 1-bit circuit with 1 instruction: └── MRX @ q[1], c[0]
- class mimiqcircuits.operations.measurereset.MeasureResetY[source]¶
Bases:
AbstractMeasurementMeasureResetY operation.
The MeasureResetY operation applies (HYZ) gate to the qubit, performs a MeasureReset operation, and then applies another HYZ gate. This sequence effectively measures the qubit in the Y-basis.
See also
MeasureReset: The standard measurement and reset operation in the Z-basis.MeasureResetX: Similar operation that measures and resets the qubit in the X-basis.Examples
>>> from mimiqcircuits import * >>> c = Circuit() >>> c.push(MeasureResetY(), 1, 0) 2-qubit, 1-bit circuit with 1 instruction: └── MRY @ q[1], c[0] >>> c.decompose() 2-qubit, 1-bit circuit with 1 instruction: └── MRY @ q[1], c[0]
- class mimiqcircuits.operations.measurereset.MeasureResetZ[source]¶
Bases:
AbstractMeasurementThis class acting as an alias for
MeasureReset.