Cytnx v1.0.0
Loading...
Searching...
No Matches
Physics.hpp
Go to the documentation of this file.
1#ifndef CYTNX_PHYSICS_H_
2#define CYTNX_PHYSICS_H_
3
4#include "Type.hpp"
5#include "Device.hpp"
6#include "cytnx_error.hpp"
7#include <vector>
8#include <initializer_list>
9#include <string>
10
11#include "Tensor.hpp"
12#include "UniTensor.hpp"
13
14#ifdef BACKEND_TORCH
15#else
16
17namespace cytnx {
18 namespace physics {
20
31 Tensor spin(const cytnx_double &S, const std::string &Comp, const int &device = Device.cpu);
32
34 Tensor spin(const cytnx_double &S, const char &Comp, const int &device = Device.cpu);
36
38
48 Tensor pauli(const std::string &Comp, const int &device = Device.cpu);
49
51 Tensor pauli(const char &Comp, const int &device = Device.cpu);
53
54 #define kBoltz cytnx_double(1.380649e-23) // J/K
55 #define hPlanck cytnx_double(6.62607015e-34) // J-s
56 #define hBar cytnx_double(1.05457181e-34) // J-s
57
58 } // namespace physics
59} // namespace cytnx
60
61namespace cytnx {
62 namespace operators {
63
64 UniTensor Sz_shalf(const int &device = Device.cpu, const bool &conserve_qns = false);
65 UniTensor Sp_shalf(const int &device = Device.cpu, const bool &conserve_qns = false,
66 const std::string &aux_dir = "r");
67 UniTensor Sn_shalf(const int &device = Device.cpu, const bool &conserve_qns = false,
68 const std::string &aux_dir = "r");
69
70 } // namespace operators
71} // namespace cytnx
72
74namespace cytnx {
75 namespace qgates {
76 UniTensor pauli_x(const int &device = Device.cpu);
77 UniTensor pauli_y(const int &device = Device.cpu);
78 UniTensor pauli_z(const int &device = Device.cpu);
79 UniTensor hadamard(const int &device = Device.cpu);
80 UniTensor phase_shift(const cytnx_double &phase, const int &device = Device.cpu);
81 UniTensor swap(const int &device = Device.cpu);
82 UniTensor sqrt_swap(const int &device = Device.cpu);
83 UniTensor toffoli(const int &device = Device.cpu);
84 UniTensor cntl_gate_2q(const UniTensor &gate_1q);
85
86 } // namespace qgates
87
88} // namespace cytnx
90
91#endif // BACKEND_TORCH
92
93#endif // CYTNX_PHYSICS_H_
an tensor (multi-dimensional array)
Definition Tensor.hpp:41
An Enhanced tensor specifically designed for physical Tensor network simulation.
Definition UniTensor.hpp:2599
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.