Cytnx v0.9.1
Loading...
Searching...
No Matches
Physics.hpp
Go to the documentation of this file.
1#ifndef _Physics_H_
2#define _Physics_H_
3#include "Type.hpp"
4#include "Device.hpp"
5#include "cytnx_error.hpp"
6#include "Tensor.hpp"
7#include "UniTensor.hpp"
8#include <vector>
9#include <initializer_list>
10#include <string>
11namespace cytnx {
12 namespace physics {
14
25 Tensor spin(const cytnx_double &S, const std::string &Comp, const int &device = Device.cpu);
26
28 Tensor spin(const cytnx_double &S, const char &Comp, const int &device = Device.cpu);
30
32
42 Tensor pauli(const std::string &Comp, const int &device = Device.cpu);
43
45 Tensor pauli(const char &Comp, const int &device = Device.cpu);
47
48#define kBoltz cytnx_double(1.380649e-23) // J/K
49#define hPlanck cytnx_double(6.62607015e-34) // J-s
50#define hBar cytnx_double(1.05457181e-34) // J-s
51
52 } // namespace physics
53} // namespace cytnx
54
55namespace cytnx {
56 namespace operators {
57
58 UniTensor Sz_shalf(const int &device = Device.cpu, const bool &conserve_qns = false);
59 UniTensor Sp_shalf(const int &device = Device.cpu, const bool &conserve_qns = false,
60 const std::string &aux_dir = "r");
61 UniTensor Sn_shalf(const int &device = Device.cpu, const bool &conserve_qns = false,
62 const std::string &aux_dir = "r");
63
64 } // namespace operators
65} // namespace cytnx
66
68namespace cytnx {
69 namespace qgates {
70 UniTensor pauli_x(const int &device = Device.cpu);
71 UniTensor pauli_y(const int &device = Device.cpu);
72 UniTensor pauli_z(const int &device = Device.cpu);
73 UniTensor hadamard(const int &device = Device.cpu);
74 UniTensor phase_shift(const cytnx_double &phase, const int &device = Device.cpu);
75 UniTensor swap(const int &device = Device.cpu);
76 UniTensor sqrt_swap(const int &device = Device.cpu);
77 UniTensor toffoli(const int &device = Device.cpu);
78 UniTensor cntl_gate_2q(const UniTensor &gate_1q);
79
80 } // namespace qgates
81
82} // namespace cytnx
84
85#endif
an tensor (multi-dimensional array)
Definition Tensor.hpp:345
An Enhanced tensor specifically designed for physical Tensor network simulation.
Definition UniTensor.hpp:1705
UniTensor Sn_shalf(const int &device=Device.cpu, const bool &conserve_qns=false, const std::string &aux_dir="r")
UniTensor Sp_shalf(const int &device=Device.cpu, const bool &conserve_qns=false, const std::string &aux_dir="r")
UniTensor Sz_shalf(const int &device=Device.cpu, const bool &conserve_qns=false)
Tensor pauli(const std::string &Comp, const int &device=Device.cpu)
create Pauli matrix.
Tensor spin(const cytnx_double &S, const std::string &Comp, const int &device=Device.cpu)
create Spin-S representation matrix.
Definition Accessor.hpp:12
Device_class Device
data on which devices.
double cytnx_double
Definition Type.hpp:43