FermionicMeasure¶
- class FermionicMeasure(*args, _force_mutable=False, **kwargs)¶
Bases:
FermionicInstruction,MeasureA measurement of a single fermionic mode, writing its outcome into one classical bit.
This is the fermionic counterpart of
Measure, and the one instruction on aFermionicCircuitthat is not aFermionicGate: a measurement is not unitary, andGateadmits no classical bits. Place it withFermionicCircuit.measure()orFermionicCircuit.measure_all()rather than constructing it directly.It subclasses
Measureso that the circuit drawers, which dispatch onisinstance(op, Measure), render it with the usual measurement symbol rather than as a generic boxed instruction.Important
What the measured bit means is decided by the fermion-to-qubit encoding, not by this instruction. Under an occupation-basis encoding such as Jordan-Wigner, mode \(i\) is carried by a single qubit and the bit is that mode’s occupation, which is the reading
TrivialOccupationFermionicMeasureSynthesisimplements. AF2QLayoutrelates whole registers whose two sides may differ in size, so in general a mode has no single qubit to measure; an encoding for which that is the case needs its own synthesis plugin, and this instruction carries no encoding assumption of its own.See also
TrivialOccupationFermionicMeasureSynthesisfor the occupation-basis lowering, andFermionicCircuit.measure_all()for the convenient way to read out an entire circuit.Initializing this instruction can be done with the arguments listed below.
- Parameters:
label – the string label of this instruction.