The Gas class#

class torchgpe.bec2D.gas.Gas(element='87Rb', N_particles=1000000, N_grid=256, grid_size=1e-06, device=None, float_dtype=torch.float64, complex_dtype=torch.complex128, adimensionalization_length=1e-06)[source]#

Quantum gas.

The parameters N_grid and grid_size specify a computational grid on which the wavefunction is defined and evolved. Gas exposes methods to perform real time propagation and to compute the ground state’s wave function via imaginary time propagation.

Parameters:
  • element (str) – Optional. The element the gas is made of. Defaults to “87Rb”.

  • N_particles (int) – Optional. The number of particles in the gas. Defaults to \(10^6\).

  • N_grid (int) – Optional. The number of points on each side of the computational grid. Defaults to \(2^8\).

  • grid_size (float) – Optional. The side of the computational grid. Defaults to \(10^{-6}\).

  • device (torch.device or None) – Optional. The device where to store tensors. Defaults to None, meaning that GPU will be used if available.

  • float_dtype (torch.dtype) – Optional. The dtype used to represent floating point numbers. Defaults to torch.double.

  • complex_dtype (torch.dtype) – Optional. The dtype used to represent complex numbers. Defaults to torch.complex128.

  • adimensionalization_length (float) – Optional. The unit of length to be used during the simulations. Defaults to \(10^{-6}\).

Attributes

element

The element the gas is made of.

mass

The mass of the gas.

d2_pulse

The pulse of the \(d_2\) line.

N_particles

The number of particles in the gas.

device

The device where to store tensors.

float_dtype

The dtype used to represent floating point numbers.

complex_dtype

The dtype used to represent complex numbers.

adim_length

Adimensionalization length used to work with pure numbers.

adim_pulse

Adimensionalization pulse used to work with pure numbers.

grid_size_x

mathx axis in adimensionalized units.

grid_size_y

The side of the computational grid along the y axis in adimensionalized units.

N_grid

The number of points on each side of the computational grid.

x

The vector of adimensionalized grid coordinates along the \(x\) axis.

y

The vector of adimensionalized grid coordinates along the \(y\) axis.

dx

The distance between two consecutive points of the grid along the \(x\) axis in adimensionalized units.

dy

The distance between two consecutive points of the grid along the \(y\) axis in adimensionalized units.

X

The matrix of \(x\) coordinates of the grid in adimensionalized units.

Y

The matrix of \(y\) coordinates of the grid in adimensionalized units.

kx

The vector of adimensionalized momenta along the \(kx\) axis.

ky

The vector of adimensionalized momenta along the \(ky\) axis.

dkx

The distance between two consecutive points of the grid along the \(kx\) axis in adimensionalized units.

dky

The distance between two consecutive points of the grid along the \(ky\) axis in adimensionalized units.

Kx

The matrix of \(kx\) coordinates of the grid in adimensionalized units.

Ky

The matrix of \(ky\) coordinates of the grid in adimensionalized units.

Methods

ground_state

Compute the ground state's wave function.

propagate

Propagate the wave function in real time.

Properties

psi

The real space wave function of the gas.

psik

The momentum space wave function of the gas.

density

The density of the gas in real space

densityk

The density of the gas in momentum space

phase

The phase (in radians) of the real space wave function

coordinates

The coordinates of the gas

momenta

The momenta of the gas