Massively Parallel Trotter-Suzuki Solver  1.6.2
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
Solver Class Reference

This class defines the evolution tasks. More...

#include <trottersuzuki.h>

Public Member Functions

 Solver (Lattice *grid, State *state, Hamiltonian *hamiltonian, double delta_t, string kernel_type="cpu")
 
 Solver (Lattice *grid, State *state1, State *state2, Hamiltonian2Component *hamiltonian, double delta_t, string kernel_type="cpu")
 
void evolve (int iterations, bool imag_time=false)
 Evolve the state of the system.
 
void update_parameters ()
 Notify the solver if any parameter changed in the Hamiltonian.
 
double get_total_energy (void)
 Get the total energy of the system.
 
double get_squared_norm (size_t which=3)
 Get the squared norm of the state (default: total wave-function). More...
 
double get_kinetic_energy (size_t which=3)
 Get the kinetic energy of the system. More...
 
double get_potential_energy (size_t which=3)
 Get the potential energy of the system. More...
 
double get_rotational_energy (size_t which=3)
 Get the rotational energy of the system. More...
 
double get_intra_species_energy (size_t which=3)
 Get the intra-particles interaction energy of the system. More...
 
double get_LeeHuangYang_energy (void)
 Get the LeeHuangYang energy (only first component);.
 
double get_inter_species_energy (void)
 Get the inter-particles interaction energy of the system.
 
double get_rabi_energy (void)
 Get the Rabi energy of the system.
 
void set_exp_potential (double *real, int real_length, double *imag, int imag_length, int which)
 Set exponential potential directly from Python.
 

Public Attributes

Lattice * grid
 Lattice object.
 
Statestate
 State of the first component.
 
Statestate_b
 State of the second component.
 
Hamiltonianhamiltonian
 Hamiltonian of the system; either single component or two components.
 
double current_evolution_time
 Amount of time evolved since the beginning of the evolution.
 

Private Member Functions

void initialize_exp_potential (double time_single_it, int which)
 Initialize the evolution operator regarding the external potential.
 
void init_kernel ()
 Initialize the kernel (cpu or gpu).
 
void calculate_energy_expected_values (void)
 Calculate all the expectation values and the state's norm.
 

Private Attributes

bool imag_time
 Whether the time of evolution is imaginary(true) or real(false).
 
double ** external_pot_real
 Real part of the evolution operator regarding the external potential.
 
double ** external_pot_imag
 Imaginary part of the evolution operator regarding the external potential.
 
double delta_t
 A single evolution iteration, evolves the state for this time.
 
double norm2 [2]
 Squared norms of the two wave function.
 
bool single_component
 Whether the system is single-component(true) or two-components(false).
 
string kernel_type
 Which kernel are being used (cpu or gpu).
 
ITrotterKernel * kernel
 Pointer to the kernel object.
 
double total_energy
 Total energy of the system.
 
double kinetic_energy [2]
 Kinetic energy for the single components.
 
double tot_kinetic_energy
 Total kinetic energy of the system.
 
double potential_energy [2]
 Potential energy for the single components.
 
double tot_potential_energy
 Total potential energy of the system.
 
double rotational_energy [2]
 Rotational energy for the single components.
 
double tot_rotational_energy
 Total Rotational energy of the system.
 
double intra_species_energy [2]
 Intra-particles interaction energy for the single components.
 
double tot_intra_species_energy
 Total intra-particles interaction energy of the system.
 
double LeeHuangYang_energy
 LeeHuangYang energy term.
 
double inter_species_energy
 Inter-particles interaction energy of the system.
 
double rabi_energy
 Rabi energy of the system.
 
bool has_parameters_changed
 Keeps track whether the Hamiltonian parameters were changed.
 
bool energy_expected_values_updated
 Whether the expectation values are updated or not.
 
bool is_python
 

Detailed Description

This class defines the evolution tasks.

Constructor & Destructor Documentation

Solver::Solver ( Lattice *  _grid,
State _state,
Hamiltonian _hamiltonian,
double  _delta_t,
string  _kernel_type = "cpu" 
)

Construct the Solver object for a single-component system.

Parameters
[in]gridLattice object.
[in]stateState of the system.
[in]hamiltonianHamiltonian of the system.
[in]delta_tA single evolution iteration, evolves the state for this time.
[in]kernel_typeWhich kernel to use (either cpu or gpu).

Massively Parallel Trotter-Suzuki Solver

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Solver::Solver ( Lattice *  grid,
State state1,
State state2,
Hamiltonian2Component hamiltonian,
double  delta_t,
string  kernel_type = "cpu" 
)

Construct the Solver object for a two-component system.

Parameters
[in]gridLattice object.
[in]state1First component's state of the system.
[in]state2Second component's state of the system.
[in]hamiltonianHamiltonian of the two-component system.
[in]delta_tA single evolution iteration, evolves the state for this time.
[in]kernel_typeWhich kernel to use (either cpu or gpu).

Member Function Documentation

double Solver::get_intra_species_energy ( size_t  which = 3)

Get the intra-particles interaction energy of the system.

Parameters
[in]whichWhich = 1(first component); 2 (second component); 3(total state)
double Solver::get_kinetic_energy ( size_t  which = 3)

Get the kinetic energy of the system.

Parameters
[in]whichWhich = 1(first component); 2 (second component); 3(total state)
double Solver::get_potential_energy ( size_t  which = 3)

Get the potential energy of the system.

Parameters
[in]whichWhich = 1(first component); 2 (second component); 3(total state)
double Solver::get_rotational_energy ( size_t  which = 3)

Get the rotational energy of the system.

Parameters
[in]whichWhich = 1(first component); 2 (second component); 3(total state)
double Solver::get_squared_norm ( size_t  which = 3)

Get the squared norm of the state (default: total wave-function).

Parameters
[in]whichWhich = 1(first component); 2 (second component); 3(total state)

The documentation for this class was generated from the following files: