Classes
Linear Combination of Atomic Orbitals
- class qDNA.lcao.Base(xyz_identifier, xyz_data)
A class to represent a molecular system and perform various calculations on it.
- Parameters:
- xyz_identifierstr
Identifier for the xyz data.
- xyz_datapandas.DataFrame
DataFrame containing the xyz coordinates and atom types.
- Attributes:
- xyz_datapandas.DataFrame
DataFrame containing the xyz coordinates and atom types.
- identifierstr
Identifier for the xyz data.
- atomslist of str
List of atoms in the molecule.
- num_atomsint
Number of atoms in the molecule.
- atom_identifierslist of str
List of atom identifiers (e.g., ‘C_0’, ‘H_1’).
- atom_coordinatesnumpy.ndarray
Array of atom coordinates.
- atom_distance_matrixnumpy.ndarray
Matrix of distances between atoms.
- atom_bond_matrixnumpy.ndarray
Matrix indicating bonds between atoms.
- num_atom_orbitalsdict
Dictionary mapping atom types to the number of orbitals.
- orbitalslist of Orbital
List of orbitals in the molecule.
- num_orbitalsint
Number of orbitals in the molecule.
- orbital_identifierslist of str
List of orbital identifiers (e.g., ‘C_0_pz’, ‘H_1_s’).
- orbital_coordinatesnumpy.ndarray
Array of orbital coordinates.
- orbital_distance_matrixnumpy.ndarray
Matrix of distances between orbitals.
- orbital_bond_matrixnumpy.ndarray
Matrix indicating bonds between orbitals.
- atom_massesdict
Dictionary mapping atom types to their masses.
- massfloat
Total mass of the molecule.
- center_of_massnumpy.ndarray
Coordinates of the center of mass of the molecule.
- relative_atom_coordinatesnumpy.ndarray
Atom coordinates relative to the center of mass.
- relative_orbital_coordinatesnumpy.ndarray
Orbital coordinates relative to the center of mass.
- num_atom_electronsdict
Dictionary mapping atom types to the number of valence electrons.
- num_electronsint
Number of valence electrons in the molecule.
- Hnumpy.ndarray
LCAO Hamiltonian matrix.
- eigvnumpy.ndarray
Eigenvalues of the Hamiltonian matrix.
- eigsnumpy.ndarray
Eigenvectors of the Hamiltonian matrix.
- E_HOMOfloat
Energy of the highest occupied molecular orbital (HOMO).
- HOMOnumpy.ndarray
Highest occupied molecular orbital (HOMO).
- HOMO_occupationnumpy.ndarray
Occupation of the HOMO.
- HOMO_typestr
Type of the HOMO (sigma, pi, n).
- HOMO_type_occupationlist of float
Occupation of the HOMO by type.
- E_HOMO_1float
Energy of the HOMO-1.
- HOMO_1numpy.ndarray
HOMO-1.
- HOMO_occupation_1numpy.ndarray
Occupation of the HOMO-1.
- HOMO_type_1str
Type of the HOMO-1 (sigma, pi, n).
- HOMO_type_occupation_1list of float
Occupation of the HOMO-1 by type.
- E_HOMO_2float
Energy of the HOMO-2.
- HOMO_2numpy.ndarray
HOMO-2.
- HOMO_occupation_2numpy.ndarray
Occupation of the HOMO-2.
- HOMO_type_2str
Type of the HOMO-2 (sigma, pi, n).
- HOMO_type_occupation_2list of float
Occupation of the HOMO-2 by type.
- E_LUMOfloat
Energy of the lowest unoccupied molecular orbital (LUMO).
- LUMOnumpy.ndarray
Lowest unoccupied molecular orbital (LUMO).
- LUMO_occupationnumpy.ndarray
Occupation of the LUMO.
- LUMO_typestr
Type of the LUMO (sigma, pi, n).
- LUMO_type_occupationlist of float
Occupation of the LUMO by type.
- E_LUMO_1float
Energy of the LUMO+1.
- LUMO_1numpy.ndarray
LUMO+1.
- LUMO_occupation_1numpy.ndarray
Occupation of the LUMO+1.
- LUMO_type_1str
Type of the LUMO+1 (sigma, pi, n).
- LUMO_type_occupation_1list of float
Occupation of the LUMO+1 by type.
- E_LUMO_2float
Energy of the LUMO+2.
- LUMO_2numpy.ndarray
LUMO+2.
- LUMO_occupation_2numpy.ndarray
Occupation of the LUMO+2.
- LUMO_type_2str
Type of the LUMO+2 (sigma, pi, n).
- LUMO_type_occupation_2list of float
Occupation of the LUMO+2 by type.
- MO_typesdict
Dictionary mapping molecular orbital types to their identifiers.
- E_excfloat
Excitation energy (HOMO-LUMO gap).
- dipole_momentfloat
Dipole moment of the molecule.
- oscillator_strengthfloat
Oscillator strength of the molecule.
Methods
save_results(directory=’results’)
Saves the results to a JSON file.
calc_dipole_moment(MO_1=None, MO_2=None, unit=’Coulomb*Angstrom’)
Calculates the dipole moment between two molecular orbitals.
calc_oscillator_strength(dipole_moment)
Calculates the dimensionless oscillator strength.
calc_MO(identifier, deviation=0)
Returns properties of the molecular orbital.
- calc_MO(identifier, deviation=0)
Calculate the Molecular Orbital (MO) properties.
- Parameters:
- identifierstr
The identifier for the MO to calculate. Should be either “HOMO” (Highest Occupied Molecular Orbital) or “LUMO” (Lowest Unoccupied Molecular Orbital).
- deviationint, optional
The deviation from the HOMO or LUMO level to calculate. Default is 0.
- Returns:
- E_MOfloat
The energy of the specified MO.
- MOnumpy.ndarray
The molecular orbital eigenvector.
- MO_occupationnumpy.ndarray
The occupation of the molecular orbital.
- MO_typestr
The type of the molecular orbital.
- MO_type_occupationfloat
The occupation of the molecular orbital type.
- calc_dipole_moment(MO_1=None, MO_2=None, unit='Coulomb*Angstrom')
Calculate the dipole moment between two molecular orbitals: one from the HOMO, the other one from the LUMO. The function weigthens the overlap by the relative vector with respect to the center of mass.
- Parameters:
- MO_1numpy.ndarray, optional
Molecular orbital coefficients for the first orbital. If None, defaults to HOMO.
- MO_2numpy.ndarray, optional
Molecular orbital coefficients for the second orbital. If None, defaults to LUMO.
- unitstr, optional
Unit of the dipole moment. Options are “Coulomb*Angstrom”, “Debye”, and “atomic_units”. Default is “Coulomb*Angstrom”.
- Returns:
- float
The dipole moment in the specified unit.
Notes
Note
The dipole moment is calculated using \(d = \sqrt{d_x^2 + d_y^2 + d_z^2}\) where dipole_x, dipole_y, and dipole_z are the components of the dipole moment along the x, y, and z axes, respectively. The conversion factors used are:
“Coulomb*Angstrom”: No conversion needed.
“Debye”: dipole * c.c / 1e-11
“atomic_units”: dipole * 1e-10 / (c.physical_constants[“Bohr radius”][0] * c.e)
- calc_oscillator_strength(dipole_moment)
Calculate the oscillator strength of a transition.
- Parameters:
- dipole_momentfloat
The dipole moment of the transition in Coulomb*Angstrom.
- Returns:
- float
The oscillator strength of the transition.
- save_results(directory='results')
Save the calculation results to a JSON file.
- Parameters:
- directorystr, optional
The directory where the results file will be saved. Default is “results”.
Notes
Note
The results are saved in a JSON file named “results_<identifier>.json” where <identifier> is a unique identifier for the calculation. The file contains the following keys:
“E_HOMO”: The energy of the highest occupied molecular orbital (HOMO), rounded to 4 decimal places.
“E_LUMO”: The energy of the lowest unoccupied molecular orbital (LUMO), rounded to 4 decimal places.
“HOMO”: The list of HOMO values.
“LUMO”: The list of LUMO values.
“dipole_moment”: The dipole moment, rounded to 4 decimal places.
“oscillator_strength”: The oscillator strength, rounded to 4 decimal places.
- class qDNA.lcao.BasePair(base1, base2, identifier=None)
A class to represent a base pair in a DNA molecule.
- Attributes:
- base1object
The first base in the pair.
- base2object
The second base in the pair.
- identifierstr, optional
An identifier for the base pair (default is None).
- atomslist
List of atoms in the base pair.
- num_atomsint
Total number of atoms in the base pair.
- atom_identifierslist
List of atom identifiers in the base pair.
- atom_coordinatesndarray
Coordinates of atoms in the base pair.
- atom_distance_matrixndarray
Matrix of distances between atoms in the base pair.
- orbitalslist
List of orbitals in the base pair.
- num_orbitalsint
Total number of orbitals in the base pair.
- orbital_identifierslist
List of orbital identifiers in the base pair.
- orbital_coordinatesndarray
Coordinates of orbitals in the base pair.
- orbital_distance_matrixndarray
Matrix of distances between orbitals in the base pair.
- massfloat
Mass of the base pair.
- center_of_massndarray
Center of mass of the base pair.
- relative_atom_coordinatesndarray
Atom coordinates relative to the center of mass.
- relative_orbital_coordinatesndarray
Orbital coordinates relative to the center of mass.
- num_electronsint
Total number of valence electrons in the base pair.
- Hndarray
LCAO Hamiltonian matrix for the base pair.
- eigvndarray
Eigenvalues of the Hamiltonian matrix.
- eigsndarray
Eigenvectors of the Hamiltonian matrix.
- E_HOMOfloat
Energy of the highest occupied molecular orbital (HOMO).
- HOMOndarray
Highest occupied molecular orbital (HOMO).
- HOMO_occupationndarray
Occupation of the HOMO.
- HOMO_typestr
Type of the HOMO (sigma, pi, or n).
- HOMO_type_occupationlist
Occupation of the HOMO by type.
- E_HOMO_1float
Energy of the HOMO-1.
- HOMO_1ndarray
HOMO-1.
- HOMO_occupation_1ndarray
Occupation of the HOMO-1.
- HOMO_type_1str
Type of the HOMO-1 (sigma, pi, or n).
- HOMO_type_occupation_1list
Occupation of the HOMO-1 by type.
- E_HOMO_2float
Energy of the HOMO-2.
- HOMO_2ndarray
HOMO-2.
- HOMO_occupation_2ndarray
Occupation of the HOMO-2.
- HOMO_type_2str
Type of the HOMO-2 (sigma, pi, or n).
- HOMO_type_occupation_2list
Occupation of the HOMO-2 by type.
- E_LUMOfloat
Energy of the lowest unoccupied molecular orbital (LUMO).
- LUMOndarray
Lowest unoccupied molecular orbital (LUMO).
- LUMO_occupationndarray
Occupation of the LUMO.
- LUMO_typestr
Type of the LUMO (sigma, pi, or n).
- LUMO_type_occupationlist
Occupation of the LUMO by type.
- E_LUMO_1float
Energy of the LUMO+1.
- LUMO_1ndarray
LUMO+1.
- LUMO_occupation_1ndarray
Occupation of the LUMO+1.
- LUMO_type_1str
Type of the LUMO+1 (sigma, pi, or n).
- LUMO_type_occupation_1list
Occupation of the LUMO+1 by type.
- E_LUMO_2float
Energy of the LUMO+2.
- LUMO_2ndarray
LUMO+2.
- LUMO_occupation_2ndarray
Occupation of the LUMO+2.
- LUMO_type_2str
Type of the LUMO+2 (sigma, pi, or n).
- LUMO_type_occupation_2list
Occupation of the LUMO+2 by type.
- MO_typesdict
Dictionary of molecular orbital types.
- E_excfloat
Excitation energy (HOMO-LUMO gap).
Methods
save_results(directory=”results”):
Saves the results to a JSON file.
calc_MO(identifier, deviation=0):
Returns properties of the molecular orbital (MO).
- calc_MO(identifier, deviation=0)
Calculate the Molecular Orbital (MO) properties.
- Parameters:
- identifierstr
The identifier for the MO to calculate. Should be either “HOMO” (Highest Occupied Molecular Orbital) or “LUMO” (Lowest Unoccupied Molecular Orbital).
- deviationint, optional
The deviation from the HOMO or LUMO level to calculate. Default is 0.
- Returns:
- E_MOfloat
The energy of the specified MO.
- MOnumpy.ndarray
The molecular orbital eigenvector.
- MO_occupationnumpy.ndarray
The occupation of the molecular orbital.
- MO_typestr
The type of the molecular orbital.
- MO_type_occupationfloat
The occupation of the molecular orbital type.
- save_results(directory='results')
Save the calculation results to a JSON file.
- Parameters:
- directorystr, optional
The directory where the results file will be saved. Default is “results”.
Notes
Note
The results are saved in a JSON file named “results_<identifier>.json” where <identifier> is a unique identifier for the calculation. The file contains the following keys:
“E_HOMO”: The energy of the highest occupied molecular orbital (HOMO), rounded to 4 decimal places.
“E_LUMO”: The energy of the lowest unoccupied molecular orbital (LUMO), rounded to 4 decimal places.
“HOMO”: The list of HOMO values.
“LUMO”: The list of LUMO values.
- class qDNA.lcao.Dimer(molecule1, molecule2, identifier=None)
A class to represent a dimer consisting of two molecules.
- Parameters:
- molecule1Molecule
The first molecule in the dimer.
- molecule2Molecule
The second molecule in the dimer.
- identifierstr, optional
An identifier for the dimer. If not provided, it is generated from the identifiers of the two molecules.
- Attributes:
- molecule1Molecule
The first molecule in the dimer.
- molecule2Molecule
The second molecule in the dimer.
- identifierstr, optional
An identifier for the dimer. If not provided, it is generated from the identifiers of the two molecules.
- H_intnumpy.ndarray
The interaction Hamiltonian matrix between the two molecules.
- t_HOMOfloat
The hopping parameter for the highest occupied molecular orbital (HOMO).
- t_HOMO_1float
The hopping parameter for the first HOMO-1.
- t_HOMO_2float
The hopping parameter for the second HOMO-2.
- t_LUMOfloat
The hopping parameter for the lowest unoccupied molecular orbital (LUMO).
- t_LUMO_1float
The hopping parameter for the first LUMO-1.
- t_LUMO_2float
The hopping parameter for the second LUMO-2.
Methods
save_results(directory=”results”):
Saves the results of the calculation to a JSON file.
- save_results(directory='results')
Save the results of the calculation to a JSON file.
- Parameters:
- directorystr, optional
The directory where the results file will be saved (default is “results”).
Notes
Note
The results include the HOMO and LUMO energies of two molecules and their coupling terms. The results are saved in a JSON file named after the identifier of the object.
DNA Sequence
- class qDNA.DNA_Seq(upper_strand, tb_model_name, methylated=True, lower_strand='auto_complete')
A class to represent a DNA sequence and its properties based on a tight- binding model.
- Parameters:
- upper_strandstr
The upper strand of the DNA sequence.
- tb_model_namestr
The name of the tight-binding model.
- methylatedbool, optional
Indicates whether the DNA sequence is methylated (default is True).
- lower_strandstr, optional
The lower strand of the DNA sequence (default is ‘auto_complete’).
- Attributes:
- upper_strandstr
The upper strand of the DNA sequence.
- lower_strandstr
The lower strand of the DNA sequence.
- methylatedbool
Indicates whether the DNA sequence is methylated.
- tb_model_namestr
The name of the tight-binding model.
- tb_model_propsdict
Properties of the tight-binding model.
- backbonebool
Indicates whether the model includes a backbone.
- double_strandedbool
Indicates whether the DNA is double-stranded.
- num_strandsint
Number of strands in the DNA sequence.
- num_sites_per_strandint
Number of sites per strand in the DNA sequence.
- tb_dimstuple
Dimensions of the tight-binding model.
- complementary_base_dictdict
Dictionary mapping each base to its complementary base.
- dna_seqtuple
The generated DNA sequence.
Tight-binding Model
- class qDNA.model.TB_Model(tb_model_name, tb_dims)
A class to define a predefined tight-binding model.
- Parameters:
- tb_model_namestr
The name of the predefined tight-binding model.
- tb_dimstuple
A tuple specifying the dimensions of the model (number of strands, number of sites per strand).
- Attributes:
- tb_model_namestr
The name of the predefined tight-binding model.
- tb_dimstuple
The dimensions of the model (number of strands, number of sites per strand).
- num_strandsint
The number of strands in the model.
- num_sites_per_strandint
The number of sites per strand.
- num_sitesint
The total number of sites in the model.
- tb_model_propsdict
The properties of the predefined tight-binding model.
- tb_configlist of tuple
The configurations of the model.
- tb_basislist of str
The basis states of the model.
- eh_basislist of str
The electron-hole basis states of the model.
- verbosebool
Verbose mode for printing debug information.
Tight-binding Hamiltonian
- class qDNA.hamiltonian.TB_Ham(dna_seq, **ham_kwargs)
A class used to represent the tight-binding Hamiltonian for DNA sequences.
- Parameters:
- dna_seqDNA_Seq
The DNA sequence object containing the sequence and model information.
- ham_kwargsdict
Additional keyword arguments for the Hamiltonian construction.
- Attributes:
- dna_seqDNA_Seq
The DNA sequence object containing the sequence and model information.
- tb_modelTB_Model
The tight-binding model associated with the DNA sequence.
- tb_basislist
The tight-binding basis states.
- tb_sites_flattenedlist
The flattened list of tight-binding sites.
- tb_basis_sites_dictdict
Dictionary mapping the TB basis to the TB sites.
- tb_sitesnp.ndarray
The array of TB sites.
- descriptionstr
Description of the Hamiltonian (e.g., ‘1P’ or ‘2P’).
- particleslist
List of particles considered (e.g., [‘electron’, ‘hole’]).
- sourcestr
Source of the tight-binding parameters.
- unitstr
Unit of the Hamiltonian parameters.
- tb_params_electrondict
Tight-binding parameters for electrons.
- tb_params_holedict
Tight-binding parameters for holes.
- relaxationbool
Flag indicating if relaxation is considered.
- coulomb_paramfloat
Coulomb interaction parameter for the Hamiltonian.
- exchange_paramfloat
Exchange interaction parameter for the Hamiltonian.
- eh_basislist
Electron-hole basis states.
- nn_cutoffbool
Nearest-neighbor cutoff for interactions.
- matrixnp.ndarray
The Hamiltonian matrix.
- matrix_dimint
Dimension of the Hamiltonian matrix.
- backbonebool
Flag indicating if the model has a backbone.
Methods
get_param_dict(particle)
Retrieves the tight-binding parameters.
get_eigensystem()
Computes and returns the eigenvalues and eigenvectors of the Hamiltonian.
get_matrix()
Computes and returns the Hamiltonian matrix.
get_fourier(init_state, end_state, quantities)
Computes Fourier components of the Hamiltonian for given states.
get_amplitudes(init_state, end_state)
Computes and returns the amplitudes for given states.
get_frequencies(init_state, end_state)
Computes and returns the frequencies for given states.
get_average_pop(init_state, end_state)
Computes and returns the average population for given states.
get_backbone_pop(init_state)
Computes and returns the population of particles on the backbone sites.
- get_backbone_pop(init_state)
Calculate the population of particles on the backbone sites of a Fishbone model.
- Parameters:
- init_statestr
The initial state of the system.
- Returns:
- dict
A dictionary where keys are particle identifiers and values are the population of each particle on the backbone sites.
- Raises:
- AssertionError
If the model is not a Fishbone model.
- get_eigensystem()
Compute the eigenvalues and eigenvectors of the matrix. This method computes the eigenvalues and eigenvectors of the matrix associated with the instance. If the description is “2P” and relaxation is enabled, the ground state is deleted from the matrix before computing the eigensystem.
- Returns:
- tuple
- eigenvaluesndarray
The eigenvalues of the matrix.
- eigenvectorsndarray
The eigenvectors of the matrix.
- get_fourier(init_state, end_state, quantities)
Calculate the Fourier components of the transition between initial and end states.
- Parameters:
- init_statestr
The initial state from which the transition starts.
- end_statestr
The end state to which the transition occurs.
- quantitieslist of str
List of quantities to calculate. Possible values are “amplitude”, “frequency”, and “average_pop”.
- Returns:
- amplitudes_dictdict
Dictionary containing the amplitudes for each particle.
- frequencies_dictdict
Dictionary containing the frequencies for each particle.
- average_pop_dictdict
Dictionary containing the average population for each particle.
- Raises:
- AssertionError
If end_state is not in self.tb_basis. If init_state is not in self.eh_basis or self.tb_basis depending on the description.
- get_matrix()
Generate the tight-binding Hamiltonian matrix based on the system description.
- Returns:
- matrixnumpy.ndarray
The Hamiltonian matrix for the system.
- Raises:
- ValueError
If the description attribute is not “2P” or “1P”.
Notes
Note
For a “2P” description, the Hamiltonian matrix is generated using tb_ham_2P and may include interaction and relaxation terms if specified.
For a “1P” description, the Hamiltonian matrix is generated using tb_ham_1P for either electrons or holes based on the particles attribute.
- get_param_dict(particle)
Retrieves the tight-binding parameters for the selected particle. This method loads the tight-binding parameters from the specified source and model name. If the unit of the loaded parameters does not match the expected unit, it converts the parameters to the expected unit.
- Parameters:
- particlestr
The particle for which to retrieve the tight-binding parameters.
- Returns:
- tuple
- tb_paramsdict
The tight-binding parameters.
Lindblad Dissipator
- class qDNA.environment.Lindblad_Diss(tb_ham, **diss_kwargs)
Provides the operators of the form \(\sqrt{\gamma} a\) that are used in the Lindblad dissipator of the master equation.
- Parameters:
- tb_hamTBHamType
The tight-binding Hamiltonian.
- diss_kwargsdict
Additional keyword arguments for the dissipator.
- Attributes:
- tb_hamTBHamType
The tight-binding Hamiltonian.
- num_sitesint
Number of sites in the tight-binding model.
- loc_deph_ratefloat
Local dephasing rate.
- glob_deph_ratefloat
Global dephasing rate.
- uniform_relaxationbool
Flag for uniform relaxation.
- relax_ratesdict
Relaxation rates for each DNA base.
- loc_thermbool
Flag for local thermalization.
- glob_thermbool
Flag for global thermalization.
- deph_ratefloat
Dephasing rate.
- cutoff_freqfloat
Cutoff frequency.
- reorg_energyfloat
Reorganization energy.
- temperaturefloat
Temperature in Kelvin.
- spectral_densitystr
Type of spectral density (‘debye’ or ‘ohmic’).
- exponentfloat
Exponent for the Ohmic spectral density.
- relax_opslist
List of relaxation operators.
- deph_opslist
List of dephasing operators.
- therm_opslist
List of thermalizing operators.
- c_opslist
List of collapse operators.
- num_c_opsint
Number of collapse operators.
- e_opstuple
Tuple containing population, coherence, and ground state population operators.
- pop_opsdict
Population operators.
- coh_opsdict
Coherence operators.
- groundstate_pop_opsdict
Ground state population operators.
- unitstr
Unit of the operators.
Master Equation Solver
- class qDNA.dynamics.ME_Solver(tb_ham, lindblad_diss, **me_kwargs)
A class used to solve master equations using the tight-binding Hamiltonian and Lindblad dissipator.
This class provides methods to initialize the solver, set up the Hamiltonian and Lindblad dissipator, and compute various properties such as populations, coherences, and ground state populations over time.
- Parameters:
- tb_hamTB_Ham
The tight-binding Hamiltonian.
- lindblad_dissLindblad_Diss
The Lindblad dissipator.
- me_kwargsdict, optional
Additional keyword arguments for the master equation solver.
- Attributes:
- me_kwargsdict
Keyword arguments for the master equation solver.
- verbosebool
Flag for verbose output.
- t_stepsint
Number of time steps.
- t_endint
End time.
- timesnp.ndarray
Array of time points.
- t_unitstr
Time unit.
- tb_hamTB_Ham
The tight-binding Hamiltonian.
- tb_modelTB_Model
The tight-binding model.
- lindblad_dissLindblad_Diss
The Lindblad dissipator.
- init_statetuple or str
Initial state depending on the Hamiltonian description.
- init_matrixqutip.Qobj
Initial density matrix.
- resultlist
List to store the results.
- groundstate_popdict
Dictionary to store ground state population.
- popdict
Dictionary to store population of states.
- cohdict
Dictionary to store coherence of states.
Methods
get_init_matrix()
Generate the initial state matrix for the quantum system based on the Hamiltonian description.
get_result()
Calculate and return the result of the master equation solver.
get_result_particle(particle)
Retrieve the reduced density matrix for a specified particle.
get_pop()
Calculate and return the population of particles in the system.
get_coh()
Calculate and return the coherence of the system.
get_groundstate_pop()
Calculate and return the ground state population.
reset()
Resets the solver’s state by clearing results and initializing dictionaries for populations and coherences.
- get_coh()
Calculate and return the coherence of the system. This method computes the coherence of the system based on the Hamiltonian description and the Lindblad dissipation operators. It supports two types of Hamiltonian descriptions: “2P” and “1P”. For “2P” description, it uses the coherence operators from the Lindblad dissipation. For “1P” description, it constructs the coherence operators based on the tensor basis permutations. The method then solves the master equation using the QuTiP
qutip.mesolvefunction and calculates the coherence for each particle in the system.- Returns:
- dict
A dictionary where the keys are particle identifiers and the values are the computed coherence values.
- get_groundstate_pop()
Calculate and return the ground state population. This function computes the ground state population of a system described by a two- particle (2P) Hamiltonian with relaxation. If the ground state population has already been computed, it returns the cached result.
- Returns:
- dict
A dictionary containing the ground state population with the key “groundstate”.
- Raises:
- AssertionError
If the Hamiltonian description is not “2P”.
- AssertionError
If relaxation is not enabled in the Hamiltonian.
- get_init_matrix()
Generate the initial state matrix for the quantum system based on the Hamiltonian description. The method supports two types of descriptions for the tight-binding Hamiltonian (tb_ham): “2P” (two- particle) and “1P” (one- particle). Depending on the description and the initialization parameters, the initial state matrix is constructed either as a delocalized state over all exciton states or as a localized state on a single exciton state.
- Returns:
- qutip.Qobj
The initial state matrix of the quantum system as a Qobj instance from the QuTiP library.
- Raises:
- ValueError
If the Hamiltonian description is not recognized.
- get_pop()
Calculate and return the population of particles in the system. This method computes the population of particles based on the Hamiltonian description and the Lindblad dissipation operators. It uses the QuTiP library to solve the master equation and obtain the expectation values of the population operators.
- Returns:
- dict
A dictionary where the keys are particle-site combinations and the values are the corresponding population expectation values.
Notes
Note
If the population
self.popis already computed, it returns the cached result.The method supports two types of Hamiltonian descriptions: “2P” and “1P”.
For “2P” description, it uses the population operators from
self.lindblad_diss.pop_ops.For “1P” description, it constructs the population operators based on the tight-binding basis
self.tb_ham.tb_basis.The master equation is solved using
qutip.mesolvewith the Hamiltonian matrix, initial state, time points, collapse operators, and population operators.
- get_result()
Calculate and return the result of the master equation solver. This method checks if the result has already been calculated. If not, it constructs the Hamiltonian matrix and solves the master equation using QuTiP’s
qutip.mesolvefunction. The result is then stored and returned.- Returns:
- list
A list of quantum states representing the solution of the master equation at different time points.
- get_result_particle(particle)
Retrieve the reduced density matrix for a specified particle. This method checks if the result has already been calculated. If not, it calculates the result. Then, it checks if the reduced density matrix for the specified particle has been calculated. If not, it calculates the reduced density matrix for the specified particle and stores it.
- Parameters:
- particlestr
The particle for which the reduced density matrix is to be retrieved.
- Returns:
- list
A list of reduced density matrices for the specified particle.
- reset()
Resets the solver’s state by clearing results and initializing dictionaries for populations and coherences.
Notes
Note
Clears the
resultlist (for the full the all reduced density matrices).Initializes
groundstate_pop,pop, andcohdictionaries.