Quantum mechanics in 1D.
Project description
The quantum_dynamics package contains tools for simulation of 1D time-dependent Schrödinger equation. The package allows for simulation of 1D model potentials and time-dependent external interactions, e.g., an laser electric field in the dipole approximation.
This package has been created as a reference solution to an exercise in the computational physics course at Tampere University of Technology in Spring 2018.
The key numerical methods behind the package are:
finite-difference approximation of the laplacian operator with Dirichlet boundary conditions at the endpoints of the simulation grid
exponential mid-point rule for the time-evolution operator
krylov-subspace based implementation of the matrix exponential
- Upon successful installation, two executables are copied to your PATH:
qdyn_laser
plot_time_evolution
qdyn_laser
This simulates the electron in 1D soft coulomb potential (“1D hydrogen”) under laser electric field with sin^2 envelope and cosine carrier wave. Please consult the help of the script for all options: qdyn_laser --help.
After a successful simulation, an outputfile of HDF5-format is created. It contains the following datasets and groups
- coordinate_grid
The gridpoints of the coordinate space used in the calculation.
- savetimes
The times corresponding to the saved wavefunction values in the file.
- wavefunction
A 2D array of values of the wavefunction. The first index corresponds to coordinate_grid and the second index to savetimes.
- final_wavefunction
Wavefunction values at the end of the simulation.
- laser
The laser electric field for all timesteps. First column is times, second the laser electric field values.
- tise_hamiltonian
The time-independent part of the Hamiltonian matrix. It’s saved as a sparse matrix and can be loaded with quantum_dynamics.utils.load_sparse_matrix like:
from quantum_dynamics.utils import load_sparse matrix import h5py with h5py.File("myfile.h5", "r") as f: H0 = load_sparse_matrix(f['tise_hamiltonian'])
plot_time_evolution
This can be used to visualize the time-evolved density calcualted with qdyn_laser. For usage instructions, please see plot_time_evolution --help.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for quantum_dynamics-0.1.dev13.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd8520e700789128d5f5a98d0d67316367fc5de6ea600677a48303e41a704f8c |
|
MD5 | 22ed74953b101b19c86b26db8306c191 |
|
BLAKE2b-256 | e4a0e9de788cdb528b3ea1b5509d4718ff8fb8e004aecb37d3e08149e8ff02b8 |
Hashes for quantum_dynamics-0.1.dev13-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90dce9ac2345ef25712de72e3615af2502c108086dd072c8e39dab0cfdabcae3 |
|
MD5 | 0512fd041b854c4cd585ed948c7c8f63 |
|
BLAKE2b-256 | b2a8e86ffa775c7e920566e346060a586bab49922ccdffe65b8af80935fd77b3 |