Class: Quantum Mechanics

Quantum Mechanics model.

class comfit.quantum_mechanics.quantum_mechanics.QuantumMechanics(dimension, **kwargs)

Bases: BaseSystem

__init__(dimension, **kwargs)

Initializes a quamtum mechanics system evolving according to the Schrödinger equation

Parameters

dimensionint

The dimension of the system.

**kwargsdict, optional

Optional keyword arguments to set additional parameters. See https://comfitlib.com/ClassBaseSystem/.

Examples

>>> qm = cf.QuantumMechanics(3,xRes=101,yRes=101,zRes=101)
Creates a BoseEinsteinCondensate system with 3 dimensions and a spatial resolution of 101.
calc_hydrogen_state(n, l, m)

Calculate the hydrogen state with quantum numbers n,l,m

Return type:

ndarray

Parameters

nint

principal quantum number

lint

azimuthal quantum number

mint

magnetic quantum number

Returns

np.ndarray

Wavefunction of the hydrogen state. (np.ndarray)

calc_nonlinear_evolution_function_f(psi, t)

Calculate the nonlinear evolution function f of the Schrödinger equation

Return type:

ndarray

Parameters

psinp.ndarray

The wavefunction.

tfloat

Time

Returns

np.ndarray

The nonlinear evolution function f.

conf_harmonic_potential(trapping_strength=None)

Set the external potential to a harmonic trap with R_tf being the thomas fermi radius

Return type:

None

Parameters

trapping_strengthfloat, optional

The strength of the trapping potential.

Returns

None

Configures self.V_ext.

conf_hydrogen_state(n, l, m)

Set the initial condition to a hydrogen state with quantum numbers n,l,m

Return type:

None

Parameters

nint

principal quantum number

lint

azimuthal quantum number

mint

magnetic quantum number

Returns

None

Configures self.psi and self.psi_f.

conf_initial_condition_Gaussian(position=None, width=None, initial_velocity=None)

Set the initial condition to a Gaussian wavepacket.

Return type:

None

Parameters

positionarray_like, optional

The position of the wavepacket.

widthfloat, optional

The width of the wavepacket.

initial_velocityfloat or array_like, optional

The initial velocity of the wavepacket.

Returns

None

Configures self.psi and self.psi_f.

conf_wavefunction(psi)

Set the initial condition to a given wavefunction.

Return type:

None

Parameters

psinp.ndarray

The wavefunction.

Returns

None

Configures self.psi and self.psi_f.

evolve_schrodinger(number_of_steps, method='ETD4RK')

Evolve the system according to the Schrödinger equation

Return type:

None

Parameters

number_of_stepsint

Number of time steps to evolve the system.

methodstr

The method to use for the time evolution.

Returns

None

Updates self.psi and self.psi_f.