17 #ifndef _UnitaryMatrix_H
18 #define _UnitaryMatrix_H
67 double *
getBlock(
const int irrep)
const;
76 void updateUnitary(
double * workmem1,
double * workmem2,
double * vector ,
const bool multiply);
88 void saveU(std::string savename)
const;
91 void loadU(std::string loadname);
104 void build_skew_symm_x(
const int irrep,
double * xblock ,
const double * Xelem)
const;
125 std::vector< std::unique_ptr<double []> >
unitary;
void build_skew_symm_x(const int irrep, double *xblock, const double *Xelem) const
UnitaryMatrix & operator=(const UnitaryMatrix &unit)
void rotate_active_space_vectors(double *eigenvecs, double *work)
Rotate the unitary matrix to the NO eigenbasis.
void copyXsolutionBack(double *vector)
Copy the x solution back (NR, augmented NR, ...)
void jacobi_rotation(int irrep, int i, int j, double angle)
Implements a simple jacobi rotation of the i, and j th orbital.
void print_unitary() const
virtual ~UnitaryMatrix()=default
Destructor.
int getSecondIndex(const int linearindex) const
Get the second Hamiltonian index corresponding to linearindex.
int getFirstIndex(const int linearindex) const
Get the first Hamiltonian index corresponding to linearindex.
unsigned int x_linearlength
unsigned int getNumVariablesX() const
Get the number of variables in the x-parametrization of the unitary update.
void CheckDeviationFromUnitary(double *work) const
Calculate the two-norm of U^T*U - I.
std::unique_ptr< OptIndex > _index
UnitaryMatrix(const OptIndex &)
Constructor.
std::vector< std::unique_ptr< double[]> > unitary
void deleteStoredUnitary(std::string name) const
Delete the stored unitary (on disk)
void saveU(std::string savename) const
Save the unitary to disk.
void loadU(std::string loadname)
Load the unitary from disk.
double * getBlock(const int irrep) const
Get the unitary rotation for block irrep.
void updateUnitary(double *workmem1, double *workmem2, double *vector, const bool multiply)
Update the unitary transformation based on the new vector and the previous unitary.
void make_skew_symmetric()
void reset_unitary()
Resets the unitary matrix.