7 template <
class T,
int N>
24 va_start(listPointer,value);
25 int n=va_arg(listPointer,
int);
36 int n=va_arg(listPointer,
int);
48 typedef vector< T >
v;
64 v(va_arg(listPointer,int), value){}
76 for(
uint j=0;j<3;j++) at(i)[j]=symbol(m[i][j]);
79 Matrix(
const char * name,
const char ** index1,
const char ** index2):
multivector< ex,2>(0,3,3){
81 for(
uint j=0;j<3;j++){
82 string res=string(name)+
"_{"+string(index1[i])+
" "+string(index2[j])+
"}";
84 at(i)[j]=symbol(res.c_str());
104 ex c12=cos(t12), c13=cos(t13), c23=cos(t23);
105 ex s12=sin(t12), s13=sin(t13), s23=sin(t23);
110 {c12*c13,s12*c13,s13*e13t},
111 {-s12*c23-c12*s23*s13*e13,c12*c23-s12*s23*s13*e13,s23*c13},
112 {s12*s23-c12*c23*s13*e13,-c12*s23-s12*c23*s13*e13,c13*c23}
114 for(
uint i=0;i<3; i++) at(i).assign(aux[i],aux[i]+3);
118 return (exp(I*t12)+1/exp(I*t12))/2;
122 return -I*(exp(I*t12)-1/exp(I*t12))/2;
127 for(
uint i=0;i<3;i++)
128 for(
uint j=0;j<3;j++)
138 for(
uint i=0;i<3;i++)
139 for(
uint j=0;j<3;j++)
140 for(
uint k=0;k<3;k++)
141 res[i][j]=res[i][j]+m1[i][k]*m2[k][j];
148 for(
uint i=0;i<3;i++)
149 for(
uint j=0;j<3;j++)
150 res[i][j]=m1[i][j]+m2[i][j];
Matrix(ex m1, ex m2, ex m3)
constructs a diagonal matrix
Matrix conjugate() const
computes the hermitian conjugate of the matrix
Matrix operator*(const Matrix &m1, const Matrix &m2)
computes the matrix product
multivector(const T &value, va_list &listPointer)
Auxiliary constructor (recursive)
A vector of vectors of vectors of... (N times) of class T objects.
multivector(const multivector &m)
Copy constructor.
Matrix(ex t12, ex t13, ex t23, ex d13)
constructs a unitary matrix in the standard form
multivector(const multivector &m)
Copy constructor.
Matrix(const char *name, const char **index1, const char **index2)
constructs a symbolic matrix with the symbols names given by the arguments
Matrix(ex m1)
constructs a diagonal matrix with all diagonal elements equal
multivector()
Default constructor.
multivector()
Default constructor.
Matrix(const char *m[3][3])
constructs a symbolic matrix with the symbols names given by the argument
multivector(const T &value, va_list &listPointer)
Auxiliary constructor.
multivector(const T &value,...)
Recommended constructor.
ex sn(ex t12)
used in the unitary constructor
vector< multivector< T, N-1 > > v
ex cs(ex t12)
used in the unitary constructor
multivector(const T &value, int x)
Recommended constructor.
Matrix operator+(const Matrix &m1, const Matrix &m2)
computes the matrix sum