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.
Parameters
- dimint
The dimension of the system.
- kwargsdict, optional
Optional keyword arguments to set additional parameters. see https://comfitlib.com/ClassBoseEinsteinCondensate/
Returns
- BoseEinsteinCondensate
The system object representing the BoseEinsteinCondensate simulation.
Examples
>>> 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
Returns
- numpy.ndarray
Average force on the potential
- calc_hamiltonian()
Function that calculates the Hamiltonian
- Return type:
float
Returns
- float
The Hamiltonian
- calc_hamiltonian_density()
Calculates the hamiltonian density
- Return type:
ndarray
Returns
- numpy.ndarray
The hamiltonian density
- calc_harmonic_potential(thomas_fermi_radius)
Calculates a harmonic trap with thomas_fermi_radius being the Thomas-Fermi radius
- Return type:
ndarray
Parameters
- thomas_fermi_radiusfloat
The Thomas-Fermi radius
Returns
- numpy.ndarray
A harmonic potential
- calc_kinetic_energy()
Calculates the kinetic energy.
- Return type:
float
Returns
- float
The kinetic energy
- calc_nonlinear_evolution_function_f(psi, t)
Calculates the non-linear evolution term of the dGPE
- Return type:
ndarray
Parameters
- psinumpy.ndarray
the wavefunction at a given time.
Returns
- numpy.ndarray
The non-linear evolution term
- 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
Parameters
- psinumpy.ndarray
the wavefunction at a given time.
Returns
- numpy.ndarray
the non-linear evolution term
- calc_superfluid_current()
Calculates the superfluid current
- Return type:
ndarray
Returns
- numpy.ndarray
The superfluid current
- calc_velocity()
Calculates the weighted velocity field
- Return type:
ndarray
Returns
- numpy.ndarray
The weighted velocity field
- calc_vortex_density(psi=None)
Calculates the vortex density of the system.
- Return type:
ndarray
Parameters
- psinumpy.ndarray, optional
The wavefunction of the system. If None, self.psi[0] is used.
Returns
- numpy.ndarray
The vortex density of the system.
- calc_vortex_density_singular()
Calculates the vortex density of the system using the singular method.
- Return type:
ndarray
Returns
- numpy.ndarray
The vortex density of the system.
- calc_vortex_nodes(dt_psi=None)
Calculate the positions and charges of vortex nodes based on the defect density.
- Return type:
list[dict]
Parameters
- dt_psinumpy.ndarray, optional
The time derivative of the wavefunction of the system.
Returns
- list of dict
- 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
Parameters
- dt_psinumpy.ndarray
The time derivative of the wavefunction of the system.
- psinumpy.ndarray, optional
The wavefunction of the system. If None, self.psi[0] is used.
Returns
- numpy.ndarray
The vortex velocity field of the system.
- 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
Parameters
- interface_widthfloat
length of the interface between the low gamma and high gamma regions
- frame_width_xfloat
distance from center to the frame in x-direction
- frame_width_yfloat
– “ – y-direction
- frame_width_zfloat
– “ – z-direction
Returns
- None
modify self.gamma
- conf_external_potential(V_ext, additive=False)
Sets the external potential of the system.
- Return type:
None
Parameters
- V_extfunction or float
the external potential
- additivebool, optional
whether to add the new potential to the existing potential or not
Returns
- None
Modifies the value of self.V_ext
- conf_initial_condition_disordered(noise_strength=0.01)
Sets disordered initial condition for the BoseEinsteinCondensate with some thermal fluctuations
- Return type:
ndarray
Parameters
- noise_strengthfloat
the strength of the noise
Returns
- None
Sets the value of self.psi and self.psi_f. self.psi always carries a leading component axis, so self.psi[0] is set to the newly configured disordered state.
- conf_initial_condition_thomas_fermi()
Finds the Thomas_Fermi ground state.
Must be preceded by an energy relaxation to find the true ground state
- Return type:
None
Returns
- None
Sets the value of self.psi and self.psi_f. self.psi always carries a leading component axis, so self.psi[0] is set to the newly configured Thomas-Fermi state.
- conf_insert_vortex(charge=1, position=None)
Sets the initial condition for a vortex dipole
Parameters
- chargeint
the charge of the vortex
- positionlist
the position of the vortex
Returns
- None
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.
Returns
- None
Modifies the value of self.psi and self.psi_f
Raises
- Exception
If the dimension of the system is not 2.
- conf_insert_vortex_filament(position=None, charge=None)
Insert a vortex line into the condensate. The vortex line is assumed to be elongated along the z-axis.
- Return type:
None
Parameters
- positionarray_like, optional
the position in the xy-plane of the vortex filament (vector)
- chargeint, optional
the charge of the vortex filament
Returns
- None
Modifies the value of self.psi and self.psi_f
- 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
Parameters
- positionlist, optional
the position of the vortex ring
- radiusfloat, optional
the radius of the vortex ring
- normal_vectorlist, optional
the normal vector of the vortex ring
Returns
- None
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
Parameters
- nodeslist
a list containing the vortices
- areaarray
list on the format (x1,x2,y1,y2)
Returns
- None
Modifies the value of self.psi and self.psi_f
- evolve_comoving_dGPE(number_of_steps, vel_x, 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
Parameters
- number_of_stepsint
the number of time steps that we are evolving the equation
- vel_xfloat
velocity in x direction
- methodstring
the integration method we want to use. ETD2RK is sett as default
Returns
- None
Updates the fields self.psi and self.psi_f
- evolve_dGPE(number_of_steps, method='ETD2RK')
Evolver for the dGPE.
- Return type:
None
Parameters
- number_of_stepsint
the number of time steps that we are evolving the equation
- methodstring, optional
the integration method we want to use. ETD2RK is sett as default
Returns
- None
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
Parameters
- number_of_stepsint
the number of time steps that we are evolving the equation
- methodstring
the integration method we want to use. ETD2RK is sett as default
Returns
- None
Updates the self.psi and self.psi_f