699 const bool &is_vT =
true);
713 const bool &is_UvT =
true,
714 const bool &return_err =
false);
729 const bool &is_U =
true,
const bool &is_vT=
true,
730 const bool &return_err =
false);
734 std::vector<cytnx::UniTensor>
Hosvd(
736 const bool &is_core =
true,
const bool &is_Ls =
false,
737 const std::vector<cytnx_int64> &trucate_dim = std::vector<cytnx_int64>());
747 template <
typename T>
757 template <
typename T>
800 const cytnx_int64 &b = 1,
const bool &by_label =
false);
1467 std::vector<Tensor>
Svd(
const Tensor &Tin,
const bool &is_UvT =
true);
1497 std::vector<Tensor>
Gesvd(
const Tensor &Tin,
const bool &is_U =
true,
const bool &is_vT =
true);
1534 const double &err = 0,
const bool &is_UvT =
true,
1535 const bool &return_err =
false);
1573 const double &err = 0,
const bool &is_U =
true,
const bool &is_vT =
true,
1574 const bool &return_err =
false);
1579 const Tensor &Tin,
const std::vector<cytnx_uint64> &mode,
const bool &is_core =
true,
1580 const bool &is_Ls =
false,
1581 const std::vector<cytnx_int64> &trucate_dim = std::vector<cytnx_int64>());
1610 std::vector<Tensor>
Qr(
const Tensor &Tin,
const bool &is_tau =
false);
1633 std::vector<Tensor>
Qdr(
const Tensor &Tin,
const bool &is_tau =
false);
1657 std::vector<Tensor>
Eigh(
const Tensor &Tin,
const bool &is_V =
true,
const bool &row_v =
false);
1680 std::vector<Tensor>
Eig(
const Tensor &Tin,
const bool &is_V =
true,
const bool &row_v =
false);
1962 const std::vector<cytnx_uint64> &idxr,
const bool &cacheL =
false,
1963 const bool &cacheR =
false);
1985 const std::vector<cytnx_uint64> &idxr,
const bool &diag_L);
2020 const bool &Tr_pad_left =
false);
2101 const bool &is_row =
false,
bool throw_excp =
false);
2117 template <
typename T>
2136 template <
typename T>
2184 const cytnx_uint64 &k = 1,
const bool &is_V =
true,
const bool &verbose =
false);
2219 const std::string method =
"Gnd",
const double &CvgCrit = 1.0e-14,
2220 const unsigned int &Maxiter = 10000,
const cytnx_uint64 &k = 1,
2221 const bool &is_V =
true,
const bool &is_row =
false,
2222 const cytnx_uint32 &max_krydim = 0,
const bool &verbose =
false);
2257 const std::string method =
"Gnd",
2258 const double &CvgCrit = 1.0e-14,
2259 const unsigned int &Maxiter = 10000,
const cytnx_uint64 &k = 1,
2260 const bool &is_V =
true,
const bool &is_row =
false,
2261 const cytnx_uint32 &max_krydim = 4,
const bool &verbose =
false);
2289 const double &CvgCrit = 1.0e-14,
const bool &is_row =
false,
2291 const bool &verbose =
false);
2315 const bool &verbose =
false,
2316 const unsigned int &Maxiter = 100000);
2339 const double &CvgCrit = 1.0e-14,
const bool &is_V =
true,
2340 const bool &verbose =
false,
2341 const unsigned int &Maxiter = 100000);
A class to represent a scalar.
Definition Scalar.hpp:2470
an tensor (multi-dimensional array)
Definition Tensor.hpp:345
An Enhanced tensor specifically designed for physical Tensor network simulation.
Definition UniTensor.hpp:2449
std::vector< cytnx::UniTensor > Svd_truncate(const cytnx::UniTensor &Tin, const cytnx_uint64 &keepdim, const double &err=0, const bool &is_UvT=true, const bool &return_err=false)
Perform Singular-Value decomposition on a UniTensor with truncation.
std::vector< cytnx::UniTensor > Qr(const cytnx::UniTensor &Tin, const bool &is_tau=false)
Perform the QR decomposition on a UniTensor.
Tensor Dot(const Tensor &Tl, const Tensor &Tr)
dot product of two arrays.
cytnx::UniTensor Trace(const cytnx::UniTensor &Tin, const cytnx_int64 &a=0, const cytnx_int64 &b=1)
Tensor Tensordot(const Tensor &Tl, const Tensor &Tr, const std::vector< cytnx_uint64 > &idxl, const std::vector< cytnx_uint64 > &idxr, const bool &cacheL=false, const bool &cacheR=false)
perform tensor dot by sum out the indices assigned of two Tensors.
std::vector< Tensor > Eig(const Tensor &Tin, const bool &is_V=true, const bool &row_v=false)
eigen-value decomposition for generic square matrix
Tensor Sum(const Tensor &Tn)
get the sum of all the elements.
Tensor Min(const Tensor &Tn)
get the minimum element.
void iSub(Tensor &Lt, const Tensor &Rt)
The subtraction function for Tensot, inplscely.
void Gemm_(const Scalar &a, const Tensor &x, const Tensor &y, const Scalar &b, Tensor &c)
Blas Gemm, performing , inplacely.
void Abs_(Tensor &Tin)
inplace perform elementwiase absolute value. @This is just a inplace version of Abs....
void Pow_(UniTensor &Tin, const double &p)
Take power p on all the elements in UniTensor, inplacely.
Tensor Abs(const Tensor &Tin)
Elementwise absolute value.
Tensor Outer(const Tensor &Tl, const Tensor &Tr)
perform outer produces of two rank-1 Tensor.
std::vector< cytnx::UniTensor > Gesvd_truncate(const cytnx::UniTensor &Tin, const cytnx_uint64 &keepdim, const double &err=0, const bool &is_U=true, const bool &is_vT=true, const bool &return_err=false)
Perform Singular-Value decomposition on a UniTensor with truncation.
void Axpy_(const Scalar &a, const Tensor &x, Tensor &y)
Blas Axpy, performing , inplacely.
Tensor Conj(const Tensor &Tin)
Conjugate all the element in Tensor.
std::vector< cytnx::UniTensor > Svd(const cytnx::UniTensor &Tin, const bool &is_UvT=true)
Perform Singular-Value decomposition on a UniTensor using divide-and-conquer method.
Tensor Matmul(const Tensor &TL, const Tensor &TR)
perform matrix multiplication on two tensors.
cytnx::UniTensor Mod(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
element-wise modulo
Tensor Expf(const Tensor &Tin)
Exponential all the element in Tensor.
Tensor Diag(const Tensor &Tin)
return a diagonal tensor with diagonal elements provided as Tin.
std::vector< Tensor > Lstsq(const Tensor &A, const Tensor &b, const float &rcond=-1)
Return the least-squares solution to a linear matrix equation.
std::vector< Tensor > Tridiag(const Tensor &Diag, const Tensor &Sub_diag, const bool &is_V=true, const bool &is_row=false, bool throw_excp=false)
perform diagonalization of symmetric tri-diagnoal matrix.
void Expf_(Tensor &Tin)
inplace perform Exponential on all the element in Tensor.
std::vector< UniTensor > Lanczos_Gnd_Ut(LinOp *Hop, const UniTensor &Tin, const double &CvgCrit=1.0e-14, const bool &is_V=true, const bool &verbose=false, const unsigned int &Maxiter=100000)
perform Lanczos for hermitian/symmetric matrices or linear function to get ground state and lowest ei...
Tensor Det(const Tensor &Tl)
Calculate the determinant of a tensor.
std::vector< Tensor > Eigh(const Tensor &Tin, const bool &is_V=true, const bool &row_v=false)
eigen-value decomposition for Hermitian matrix
std::vector< cytnx::UniTensor > Gesvd(const cytnx::UniTensor &Tin, const bool &is_U=true, const bool &is_vT=true)
Perform Singular-Value decomposition on a UniTensor using ?gesvd method.
Tensor Inv(const Tensor &Tin, const double &clip)
Element-wise inverse with clip.
cytnx::UniTensor Mul(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The multiplication function between two UniTensor.
std::vector< Tensor > Lanczos(LinOp *Hop, const Tensor &Tin=Tensor(), const std::string method="Gnd", const double &CvgCrit=1.0e-14, const unsigned int &Maxiter=10000, const cytnx_uint64 &k=1, const bool &is_V=true, const bool &is_row=false, const cytnx_uint32 &max_krydim=0, const bool &verbose=false)
perform Lanczos for hermitian/symmetric matrices or linear function.
Tensor Max(const Tensor &Tn)
get the maximum element.
cytnx::UniTensor Sub(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The subtraction function between two UniTensor.
Tensor Norm(const Tensor &Tl)
Calculate the norm of a tensor.
std::vector< cytnx::UniTensor > Hosvd(const cytnx::UniTensor &Tin, const std::vector< cytnx_uint64 > &mode, const bool &is_core=true, const bool &is_Ls=false, const std::vector< cytnx_int64 > &trucate_dim=std::vector< cytnx_int64 >())
Tensor Axpy(const Scalar &a, const Tensor &x, const Tensor &y=Tensor())
Blas Axpy, performing , inplacely.
void Inv_(Tensor &Tin, const double &clip)
inplace perform Element-wise inverse with clip.
Tensor Vectordot(const Tensor &Tl, const Tensor &Tr, const bool &is_conj=false)
perform inner product of vectors
void Exp_(Tensor &Tin)
inplace perform Exponential on all the element in Tensor.
Tensor Exp(const Tensor &Tin)
Exponential all the element in Tensor.
Tensor Ger(const Tensor &x, const Tensor &y, const Scalar &a=Scalar())
Blas Ger, performing return = a*vec(x)*vec(y)^T.
Tensor Gemm(const Scalar &a, const Tensor &x, const Tensor &y)
Blas Gemm, performing return.
Tensor Kron(const Tensor &Tl, const Tensor &Tr, const bool &Tl_pad_left=false, const bool &Tr_pad_left=false)
perform kronecker produces of two Tensor.
std::vector< Tensor > Lanczos_ER(LinOp *Hop, const cytnx_uint64 &k=1, const bool &is_V=true, const cytnx_uint64 &maxiter=10000, const double &CvgCrit=1.0e-14, const bool &is_row=false, const Tensor &Tin=Tensor(), const cytnx_uint32 &max_krydim=4, const bool &verbose=false)
perform Lanczos for hermitian/symmetric matrices or linear function.
std::vector< cytnx::UniTensor > Qdr(const cytnx::UniTensor &Tin, const bool &is_tau=false)
Perform the QDR decomposition on a UniTensor.
void InvM_(Tensor &Tin)
inplace matrix inverse.
void iDiv(Tensor &Lt, const Tensor &Rt)
The inplace division function for Tensor, inplacely.
cytnx::UniTensor Add(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The addtion function between two UniTensor.
Tensor Tensordot_dg(const Tensor &Tl, const Tensor &Tr, const std::vector< cytnx_uint64 > &idxl, const std::vector< cytnx_uint64 > &idxr, const bool &diag_L)
perform tensor dot by sum out the indices assigned of two Tensors, with either one of them to be a ra...
Tensor Directsum(const Tensor &T1, const Tensor &T2, const std::vector< cytnx_uint64 > &shared_axes)
perform directsum of two Tensor.
cytnx::UniTensor ExpM(const cytnx::UniTensor &Tin, const T &a, const T &b=0)
Perform the exponential function on a UniTensor.
void Conj_(Tensor &Tin)
inplace perform Conjugate on all the element in Tensor.
void iAdd(Tensor &Lt, const Tensor &Rt)
The addition function for Tensor, inplacely.
std::vector< Tensor > Lanczos_Gnd(LinOp *Hop, const double &CvgCrit=1.0e-14, const bool &is_V=true, const Tensor &Tin=Tensor(), const bool &verbose=false, const unsigned int &Maxiter=100000)
perform Lanczos for hermitian/symmetric matrices or linear function to get ground state and lowest ei...
cytnx::UniTensor ExpH(const cytnx::UniTensor &Tin, const T &a, const T &b=0)
Perform the exponential function on a UniTensor, which the blocks are Hermitian matrix.
Tensor Cpr(const Tensor &Lt, const Tensor &Rt)
The comparison function for Tensor.
UniTensor Pow(const UniTensor &Tin, const double &p)
take power p on all the elements in UniTensor.
Tensor Matmul_dg(const Tensor &Tl, const Tensor &Tr)
perform matrix multiplication on two Tensors with one rank-1 and the other rank-2 where the rank-1 re...
std::vector< Tensor > Arnoldi(LinOp *Hop, const Tensor &Tin=Tensor(), const std::string which="LM", const cytnx_uint64 &maxiter=10000, const cytnx_double &cvg_crit=1.0e-9, const cytnx_uint64 &k=1, const bool &is_V=true, const bool &verbose=false)
perform Arnoldi for matrices or linear function.
Tensor InvM(const Tensor &Tin)
Matrix inverse.
void iMul(Tensor &Lt, const Tensor &Rt)
The multiplication function for Tensor, inplacely.
cytnx::UniTensor Div(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The division function between two UniTensor.
Definition Accessor.hpp:12
cytnx::UniTensor operator*(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The multiplication operator between two UniTensor.
double cytnx_double
Definition Type.hpp:43
uint32_t cytnx_uint32
Definition Type.hpp:46
cytnx::UniTensor operator-(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The subtraction operator between two UniTensor.
Tensor operator==(const Tensor &Lt, const Tensor &Rt)
The comparison operator for Tensor.
uint64_t cytnx_uint64
Definition Type.hpp:45
int64_t cytnx_int64
Definition Type.hpp:48
cytnx::UniTensor operator%(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The modulo operator between two UniTensor.
cytnx::UniTensor operator+(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The addtion operator between two UniTensor.
cytnx::UniTensor operator/(const cytnx::UniTensor &Lt, const cytnx::UniTensor &Rt)
The division operator between two UniTensor.