Skip to main content
IBM Quantum Platform

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

∣n0,n1,…,nM−1⟩=∏m(bm†)nmnm!∣vac⟩ ,\lvert n_0, n_1, \ldots, n_{M-1} \rangle = \prod_m \frac{(b^\dagger_m)^{n_m}}{\sqrt{n_m!}} \lvert \text{vac} \rangle \, ,

where nmn_m is occupation[m]. Synthesis emits the gates that set each mode’s qubits to the pattern encoding its occupation level.

Note

The occupation entries are non-negative integers, not booleans: a single mode may hold arbitrarily many bosons.

Note

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.

Caution

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

Type: tuple[int, ...]

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 ∣0,…,0⟩\lvert 0, \ldots, 0 \rangle.

Parameters

num_modes (int) – the number of bosonic modes to initialize.

Returns

An InitializeModes gate declaring zero bosons in every mode.

Return type

InitializeModes

Was this page helpful?
Report a bug, typo, or request content on GitHub.