TrivialOccupationFermionicMeasureSynthesis

class TrivialOccupationFermionicMeasureSynthesis

Bases: object

A F2QSynthesisPlugin for transpiling FermionicMeasure with trivial occupation.

Under an occupation-basis encoding, the occupation of fermionic mode \(i\) is the computational-basis value of the single qubit that mode is mapped onto. A mode measurement therefore lowers to exactly one qubit Measure, writing into the very classical bit the FermionicMeasure was given.

Warning

This transpilation pass plugin makes the following assumptions:

  • an occupation-basis encoding (like Jordan-Wigner)

  • a trivial fermion-to-qubit layout (i.e. no change in their register lengths)

  • a 1-to-1 mapping of fermionic mode indices to qubit indices

Methods

run(in_node, out_dag, *, f2q_layout)

Runs this transpilation plugin.

Parameters:
Return type:

None

See also

The documentation of F2QSynthesisPlugin for more detailed explanations of the arguments.

Raises:
  • NotImplementedError – when in_node acts on fermionic modes that are spread across multiple FermionicRegister instances.

  • ValueError – when the mapped qubit register does not have the same length as the fermionic mode register, in which case a mode has no single qubit whose measurement would yield its occupation.

Parameters:
Return type:

None