BosonSpace

class qugradlab.hilbert_spaces.bosonic.BosonSpace(n_single_particle_states: int, truncation_level: int)[source]

Bases: HilbertSpace

Represents a truncated Fock space of boson modes.

Attributes

basis

An array of positive integers labeling the Hilbert space basis

dim

The Hilbert space dimension

inverse

An array satisfying the property self.inverse[self.basis[i]]=i

n_single_particle_states

The number of single particle states

truncation_level

The maximum number of bosons per single particle state

Methods

__init__

Initialises a BosonSpace

basis_vector

Returns a column vector represnetation corresponding to the input basis state label.

get_subspace

Generates a new subspace by filtering the basis state labels.

labels

Generates a string (list of strings) that represent the state(s).

__init__(n_single_particle_states: int, truncation_level: int)[source]

Initialises a BosonSpace

Parameters:
  • n_single_particle_states (int) – The number of single particle states

  • truncation_level (int) – The maximum number of bosons per single particle state

basis_vector(basis_state_label: int) ndarray[complex128]

Returns a column vector represnetation corresponding to the input basis state label.

Parameters:

basis_state_label (int) – A positive integer denoting the label of the basis state to generate the basis vector for.

Returns:

The basis vector corresponding to the input basis state label.

Return type:

NDArray[Shape[dim], np.complex128]

get_subspace(filter: ndarray[bool]) HilbertSpace

Generates a new subspace by filtering the basis state labels.

Parameters:

filter (NDArray[Shape[dim], bool]) – True entries are retained in the new subspace.

Returns:

The filtered subspace.

Return type:

HilbertSpace

labels(states: int | list[int] | None = None) str | list[str][source]

Generates a string (list of strings) that represent the state(s).

Parameters:

states (int | list[int], optional) – The state(s) to label. If None then the labels for all states in basis are returned. By default None.

Returns:

The label(s) for the specified states.

Return type:

str | list[str]

property basis: ndarray[int]

An array of positive integers labeling the Hilbert space basis

property dim

The Hilbert space dimension

property inverse: ndarray[int]

An array satisfying the property self.inverse[self.basis[i]]=i

property n_single_particle_states: int

The number of single particle states

property truncation_level: int

The maximum number of bosons per single particle state