InitializeModes
class InitializeModes(occupation)
Bases: BosonicGate
Prepares a bosonic Fock state.
This gate declares the occupation of the modes it is placed on, i.e. the Fock state
where is occupation[m]. Synthesis emits the gates that set each mode’s qubits to the pattern encoding its occupation level.
The occupation entries are non-negative integers, not booleans: a single mode may hold arbitrarily many bosons.
This gate does not itself fix a truncation. The occupation it declares must of course be representable by whatever cutoff the boson-to-qubit encoding uses (an occupation of 3 requires max_occupation >= 3) which the synthesis plugin checks at transpile time, since that is where the cutoff is known. max_occupation reports the largest level this gate declares.
This is an early development prototype. Beware of changes to its interface without warning during the pre-release development of this package.
Initializing an instance of this gate can be done with the arguments listed below.
Parameters
occupation (Sequence[int]) – the boson number of each mode in the BosonicRegister being initialized by this gate.
Raises
ValueError – if any occupation entry is negative.
Attributes
max_occupation
The largest occupation level this gate declares.
A boson-to-qubit encoding must retain at least this many levels to represent the declared Fock state; see occupation_encoding().
occupation
The boson number of each mode in the BosonicRegister initialized by this gate.
Methods
vacuum
classmethod vacuum(num_modes)
Builds the gate for the vacuum state .
Parameters
num_modes (int) – the number of bosonic modes to initialize.
Returns
An InitializeModes gate declaring zero bosons in every mode.
Return type