Quandary
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
HamiltonianFileReader Class Reference

Interface for reading Hamiltonian data from files. More...

#include <hamiltonianfilereader.hpp>

Public Member Functions

 HamiltonianFileReader ()
 
 HamiltonianFileReader (std::optional< std::string > hamiltonian_file_Hsys, std::optional< std::string > hamiltonian_file_Hc, DecoherenceType decoherence_type_, PetscInt dim_rho_, bool quietmode_)
 Constructor with Hamiltonian file specification.
 
 ~HamiltonianFileReader ()
 
void receiveHsys (Mat &Ad, Mat &Bd)
 Reads the constant system Hamiltonian from file.
 
void receiveHc (std::vector< Mat > &Ac_vec, std::vector< Mat > &Bc_vec)
 Receives real and imaginary control operators from file.
 

Protected Attributes

DecoherenceType decoherence_type
 Type of solver (Lindblad vs Schroedinger)
 
PetscInt dim_rho
 Dimension of the Hilbert space (N)
 
std::optional< std::string > hamiltonian_file_Hsys
 Filename for system Hamiltonian data.
 
std::optional< std::string > hamiltonian_file_Hc
 Filename for control Hamiltonian data.
 
int mpirank_world
 Rank of global MPI communicator.
 
int mpisize_world
 Rank of global MPI communicator.
 
bool quietmode
 Flag for quiet mode operation.
 

Detailed Description

Interface for reading Hamiltonian data from files.

This class provides functionality to read system and control Hamiltonians from files generated by the Python interface. It supports both Lindblad and Schroedinger solver and handles matrix data communication.

Constructor & Destructor Documentation

◆ HamiltonianFileReader() [1/2]

HamiltonianFileReader::HamiltonianFileReader ( )

◆ HamiltonianFileReader() [2/2]

HamiltonianFileReader::HamiltonianFileReader ( std::optional< std::string >  hamiltonian_file_Hsys,
std::optional< std::string >  hamiltonian_file_Hc,
DecoherenceType  decoherence_type_,
PetscInt  dim_rho_,
bool  quietmode_ 
)

Constructor with Hamiltonian file specification.

Parameters
hamiltonian_file_HsysPath to file containing system Hamiltonian data
hamiltonian_file_HcPath to file containing control Hamiltonian data
decoherence_type_Type of solver (Lindblad or Schroedinger)
dim_rho_Dimension of the Hilbert space
quietmode_Flag for quiet operation

◆ ~HamiltonianFileReader()

HamiltonianFileReader::~HamiltonianFileReader ( )

Member Function Documentation

◆ receiveHc()

void HamiltonianFileReader::receiveHc ( std::vector< Mat > &  Ac_vec,
std::vector< Mat > &  Bc_vec 
)

Receives real and imaginary control operators from file.

Reads control Hamiltonian matrices for each oscillator from the Hamiltonian file and stores them in the provided matrix vectors.

Parameters
Ac_vecReference to vector of matrices storing real parts of control system matrices. One per oscillator.
Bc_vecReference to vector of matrices storing imaginary parts of control matrices. One per oscillator.

◆ receiveHsys()

void HamiltonianFileReader::receiveHsys ( Mat &  Ad,
Mat &  Bd 
)

Reads the constant system Hamiltonian from file.

Parameters
[out]AdReference to matrix that stores the real part of the system matrix for (-i*Hsys). Must be allocated.
[out]BdReference to matrix that stores the imaginary part of the system matrix for (-i*Hsys). Must be allocated.

Member Data Documentation

◆ decoherence_type

DecoherenceType HamiltonianFileReader::decoherence_type
protected

Type of solver (Lindblad vs Schroedinger)

◆ dim_rho

PetscInt HamiltonianFileReader::dim_rho
protected

Dimension of the Hilbert space (N)

◆ hamiltonian_file_Hc

std::optional<std::string> HamiltonianFileReader::hamiltonian_file_Hc
protected

Filename for control Hamiltonian data.

◆ hamiltonian_file_Hsys

std::optional<std::string> HamiltonianFileReader::hamiltonian_file_Hsys
protected

Filename for system Hamiltonian data.

◆ mpirank_world

int HamiltonianFileReader::mpirank_world
protected

Rank of global MPI communicator.

◆ mpisize_world

int HamiltonianFileReader::mpisize_world
protected

Rank of global MPI communicator.

◆ quietmode

bool HamiltonianFileReader::quietmode
protected

Flag for quiet mode operation.


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