mimiqcircuits.operations.measurereset

Measure and reset operations.

Classes

MeasureReset()

MeasureReset operation.

MeasureResetX()

MeasureResetX operation.

MeasureResetY()

MeasureResetY operation.

MeasureResetZ()

This class acting as an alias for MeasureReset.

class mimiqcircuits.operations.measurereset.MeasureReset[source]

Bases: AbstractMeasurement

MeasureReset 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]
inverse()[source]
power(p)[source]
control(num_qubits)[source]
iswrapper()[source]
get_operation()[source]
class mimiqcircuits.operations.measurereset.MeasureResetX[source]

Bases: AbstractMeasurement

MeasureResetX 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]
inverse()[source]
power(p)[source]
control(num_qubits)[source]
iswrapper()[source]
get_operation()[source]
class mimiqcircuits.operations.measurereset.MeasureResetY[source]

Bases: AbstractMeasurement

MeasureResetY 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]
inverse()[source]
power(p)[source]
control(num_qubits)[source]
iswrapper()[source]
get_operation()[source]
class mimiqcircuits.operations.measurereset.MeasureResetZ[source]

Bases: AbstractMeasurement

This class acting as an alias for MeasureReset.