Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#ifndef _ALGEBRA_HPP_
#define _ALGEBRA_HPP_
#include "Eigen/KroneckerProduct"
#include "Eigen/Dense"
#include <vector>
namespace Algebra{
using namespace Eigen;
typedef MatrixXcd QuMatrix;
class QMat{
private:
QuMatrix mat;
public:
// construct from Eigen Matrix type
QMat(const QuMatrix& m);
QMat(int r, int c);
QMat(int n, bool ident = false);
QMat(std::vector<std::vector<std::complex<double>>> l);
~QMat(){};
// basic Matrix arithematic
// return new object
QMat operator+(const QMat& m);
QMat operator-(const QMat& m);
QMat operator*(const QMat& m);
QMat operator*(const std::complex<double> c);
// modify the object
void operator+=(const QMat& m);
void operator-=(const QMat& m);
void operator*=(const QMat& m);
void operator*=(const std::complex<double> c);
// modifiers and basic adt
void setElement(int i, int j, std::complex<double>c);
std::complex<double> getElement(int i, int j);
int rows();
int cols();
// advanced QMat operation
std::complex<double> trace();
std::complex<double> inner_product(const QMat& m);
QMat conjugateTranspose();
QMat orthoNormalize();
QMat tensor(const QMat& m);
QMat eigenValues();
QMat eigenVectors();
// printing
void serialize();
friend std::ostream& operator<<(std::ostream& out, const QMat& m);
};
};
#endif