Class: Bose Einstein Condensate
Bose Einstein Condensate model.
- class comfit.bose_einstein_condensate.bose_einstein_condensate.BoseEinsteinCondensate(dim, **kwargs)
Bases:
BaseSystem
- __init__(dim, **kwargs)
Initializes a system to simulate a Bose-Einstein Condensate using the Gross-Pitaevskii equation.
- Args:
- dimint
The dimension of the system.
- kwargsdict, optional
Optional keyword arguments to set additional parameters. see https://comfitlib.com/ClassBoseEinsteinCondensate/
- Returns:
The system object representing the BoseEinsteinCondensate simulation. BoseEinsteinCondensate object
- Example:
bec = BoseEinsteinCondensate(3,xRes=101,yRes=101,zRes=101, gamma=0.5) Creates a BoseEinsteinCondensate system with 3 dimensions and a spatial resolution of 101 in all directions. The dissipative factor gamma is set to 0.5.
- calc_force_on_external_potential()
Calculates the average force acting on the external potential.
- Return type:
ndarray
- Args:
None
- Returns:
Average force on the potential (numpy.ndarray)
- calc_hamiltonian()
Function that calculates the Hamiltonian
- Return type:
float
- Args:
None
- Returns:
The Hamiltonian
- calc_hamiltonian_density()
Calculates the hamiltonian density
- Return type:
ndarray
- Args:
None
- Returns:
The hamiltonian density (numpy.ndarray)
- calc_harmonic_potential(R_tf)
Calculates a harmonic trap with R_tf being the Thomas-Fermi radius
- Return type:
ndarray
- Args:
R_tf (float): The Thomas-Fermi radius
- Returns:
A harmonic potential
- calc_kinetic_energy()
Calculates the kinetic energy.
- Return type:
float
- Args:
None
- Returns:
The kinetic energy (float)
- calc_nonlinear_evolution_function_f(psi, t)
Calculates the non-linear evolution term of the dGPE
- Return type:
ndarray
- Args:
psi: the wavefunction at a given time. (numpy.ndarray)
- Returns:
The non-linear evolution term (numpy.ndarray)
- calc_nonlinear_evolution_term_comoving_f(psi, t)
Calculates the non-linear evolution term of the dGPE when gamma is not a constant.
Relevant for example in the comoving frame when we have a dissipative frame around the edge.
- Return type:
ndarray
- Args:
psi: the wavefunction at a given time. (numpy.ndarray)
- Returns:
the non-linear evolution term (numpy.ndarray)
- calc_superfluid_current()
Calculates the superfluid current
- Return type:
ndarray
- Args:
None
- Returns:
The superfluid current (numpy.ndarray)
- calc_velocity()
Calculates the weighted velocity field
- Return type:
ndarray
- Args:
None
- Returns:
The weighted velocity field (numpy.ndarray)
- calc_vortex_density(psi=None)
Calculates the vortex density of the system.
- Return type:
ndarray
- Args:
psi: The wavefunction of the system. (numpy.ndarray)
- Returns:
The vortex density of the system. numpy.ndarray
- calc_vortex_density_singular()
Calculates the vortex density of the system using the singular method.
- Return type:
ndarray
- Args:
None
- Returns:
The vortex density of the system. (numpy.ndarray)
- calc_vortex_nodes(dt_psi=None)
Calculate the positions and charges of vortex nodes based on the defect density.
- Return type:
list
[dict
]
- Args:
dt_psi: The time derivative of the wavefunction of the system. (numpy.ndarray)
- Returns:
- List of dictionaries representing the vortex nodes. Each dictionary contains the following keys:
‘position_index’: The position index of the vortex node in the defect density array.
‘charge’: The charge of the vortex node.
‘position’: The position of the vortex node as a list [x, y].
‘velocity’: The velocity of the vortex node as a list [vx, vy].
- calc_vortex_velocity_field(dt_psi, psi=None)
Calculates the vortex velocity field of the system.
- Return type:
ndarray
- Args:
dt_psi: The time derivative of the wavefunction of the system. (numpy.ndarray) psi: The wavefunction of the system. (numpy.ndarray)
- Returns:
The vortex velocity field of the system. numpy.ndarray:
- conf_dissipative_frame(interface_width=7, frame_width_x=None, frame_width_y=None, frame_width_z=None)
Configures a dissipative frame around the computational domain
This function sets self.gamma so that it has a low value in the bulk and a large value near the edges. This sets a dissipative frame around the computational domain
- Return type:
None
- Args:
d: length of the interface between the low gamma and high gamma regions (float) frame_width_x: distance fom center to the frame in x-direction (float) frame_width_y: – “ – y-direction (float) frame_width_z: – “ – z-direction (float)
- Returns:
modify self.gamma
- conf_external_potential(V_ext, additive=False)
Sets the external potential of the system.
- Return type:
None
- Args:
V_ext (function or float): the external potential additive (bool, optional): whether to add the new potential to the existing potential or not
- Returns:
Modifies the value of self.V_ext
- conf_initial_condition_Thomas_Fermi()
Finds the Thomas_Fermi ground state.
Must be precided by an energy relaxation to find the true ground state
- Return type:
None
- Args:
None
- Returns:
Sets the value of self.psi and self.psi_f
- conf_initial_condition_disordered(noise_strength=0.01)
Sets disordered initial condition for the BoseEinsteinCondensate with some thermal flcutiations
- Return type:
ndarray
- Args:
noise_strength: the strength of the noise
- Returns:
Sets the value of self.psi and self.psi_f
- conf_insert_vortex(charge=1, position=None)
Sets the initial condition for a vortex dipole
- Args:
charge (int): the charge of the vortex position (list): the position of the vortex
- Returns:
Modifies the value of self.psi and self.psi_f
- conf_insert_vortex_dipole(dipole_vector=None, dipole_position=None)
Sets the initial condition for a vortex dipole configuration in a 2-dimensional system.
- Args:
None
- Returns:
Modifies the value of self.psi and self.psi_f
- Raises:
Exception: If the dimension of the system is not 2.
- conf_insert_vortex_ring(position=None, radius=None, normal_vector=[0, 0, 1])
Sets the initial condition for a vortex ring configuration in a 3-dimensional system
- Return type:
None
- Args:
position: the position of the vortex ring (list) radius: the radius of the vortex ring (float) normal_vector: the normal vector of the vortex ring (list)
- Returns:
Modifies the value of self.psi and self.psi_f
- conf_vortex_remover(nodes, Area)
Removes vortices
Function that finds and removes vortices outside of the area defined by the corners (x1,y1), (x1,y2), (x2,y1), (x2,y2)
- Return type:
None
- Args:
nodes (list) a list containing the vortices Area (array) list on the format (x1,x2,y1,y2)
- Returns:
Modifies the value of self.psi and self.psi_f
- evolve_comoving_dGPE(number_of_steps, velx, method='ETD2RK')
Evolver for the dGPE in the comoving frame.
This evolver assume that the stirring is in the x-direction and that gamma is spatialy dependent
- Return type:
None
- Args:
number_of_steps: the number of time steps that we are evolving the equation (int) velx: velocity in x direction (float) method: the integration method we want to use. ETD2RK is sett as default (string)
- Returns:
Updates the fields self.psi and self.psi_f
- evolve_dGPE(number_of_steps, method='ETD2RK')
Evolver for the dGPE.
- Return type:
None
- Args:
number_of_steps: the number of time steps that we are evolving the equation (int) method: the integration method we want to use. ETD2RK is sett as default (string, optional)
- Returns:
Updates the self.psi and self.psi_f
- evolve_relax(number_of_steps, method='ETD2RK')
Evolver for the dGPE in imaginary time that relax the equation closer to the ground state
- Return type:
None
- Args:
number_of_steps: the number of time steps that we are evolving the equation (int) method: the integration method we want to use. ETD2RK is sett as default (string)
- Returns:
Updates the self.psi and self.psi_f