Quantum-Chess 0.5
Chargement...
Recherche...
Aucune correspondance
Unitary.hpp
Aller à la documentation de ce fichier.
1#ifndef UNITARY_HPP
2#define UNITARY_HPP
3#include <CMatrix.hpp>
4#include <numbers>
5#include <complex>
6#include <Constexpr.hpp>
7
8using namespace std::complex_literals;
9using namespace std::numbers;
10
11constexpr inline
13 {
14 {1, 0, 0, 0},
15 {0, 0, 1i, 0},
16 {0, 1i, 0, 0},
17 {0, 0, 0, 1}
18 }
19};
20
21
22constexpr inline
24 {
25 {1, 0, 0, 0},
26 {0, 1./sqrt2, 1i/sqrt2, 0},
27 {0, 1i/sqrt2, 1./sqrt2, 0},
28 {0, 0, 0, 1}
29 }
30};
31
32constexpr inline
34
35constexpr inline
37 {
38 {1, 0, 0, 0, 0, 0, 0, 0},
39 {0, 0, 1i, 0, 0, 0, 0, 0 },
40 {0, 1i, 0, 0, 0, 0, 0, 0},
41 {0, 0, 0, 1, 0, 0, 0, 0},
42 {0, 0, 0, 0, 1, 0, 0, 0 },
43 {0, 0, 0, 0, 0, 1, 0, 0},
44 {0, 0, 0, 0, 0, 0, 1, 0},
45 {0, 0, 0, 0, 0, 0, 0, 1}
46 }
47};
48
49constexpr inline
51 {
52 {1, 0, 0, 0, 0, 0, 0, 0},
53 {0, 0, 0, 0, 1i, 0, 0, 0 },
54 {0, 0, 1, 0, 0, 0, 0, 0},
55 {0, 0, 0, 0, 0, 0, 1i, 0},
56 {0, 1i, 0, 0, 0, 0, 0, 0 },// erreur dans le papier?
57 {0, 0, 0, 0, 0, 1, 0, 0},
58 {0, 0, 0, 1i, 0, 0, 0, 0},
59 {0, 0, 0, 0, 0, 0, 0, 1}
60 }
61};
62
63constexpr inline
65 {
66 {1, 0, 0, 0, 0, 0, 0, 0},
67 {0, 1./sqrt2, 1i/sqrt2, 0, 0, 0, 0, 0},
68 {0, 1i/sqrt2, 1./sqrt2, 0, 0, 0, 0, 0},
69 {0, 0, 0, 1, 0, 0, 0, 0},
70 {0, 0, 0, 0, 1, 0, 0, 0},
71 {0, 0, 0, 0, 0, 1./sqrt2, 1i/sqrt2, 0},
72 {0, 0, 0, 0, 0, 1i/sqrt2, 1./sqrt2, 0},
73 {0, 0, 0, 0, 0, 0, 0, 1}
74 }
75};
76
77constexpr inline
79 {
80 {1, 0, 0, 0, 0, 0, 0, 0},
81 {0, 0, 0, 0, 1i, 0, 0, 0},
82 {0, 1i/sqrt2, 1./sqrt2, 0, 0, 0, 0, 0},
83 {0, 0, 0, 0, 0, -1./sqrt2, 1i/sqrt2, 0},
84 {0, 1i/sqrt2, -1./sqrt2, 0, 0, 0, 0, 0},
85 {0, 0, 0, 0, 0, 1i/sqrt2, -1/sqrt2, 0},
86 {0, 0, 0, 1i, 0, 0, 0, 0},
87 {0, 0, 0, 0, 0, 0, 0, 1}
88 }
89};
90
91constexpr inline
93 {
94 {1, 0, 0, 0, 0, 0, 0, 0},
95 {0, 0, -1i/sqrt2, 0, -1i/sqrt2, 0, 0, 0},
96 {0, 0, 1/sqrt2, 0, -1/sqrt2, 0, 0, 0},
97 {0, 0, 0, 0, 0, 0, -1i, 0},
98 {0, -1i, 0, 0, 0, 0, 0, 0},
99 {0, 0, 0, -1/sqrt2, 0, -1i/sqrt2, 0, 0},
100 {0, 0, 0, -1i/sqrt2, 0, -1/sqrt2, 0, 0},
101 {0, 0, 0, 0, 0, 0, 0, 1}
102 }
103};
104
105constexpr inline
117
118CONSTEXPR inline
122 CMatrix<8>{}, conj(CMatrix<2>::identity().tensoriel_product(MATRIX_ISWAP).transposed())
123 },
124 CMatrix<16>{},
125 CMatrix<16>{},
127 conj(MATRIX_ISWAP_8.transposed()), CMatrix<8>{},
129 }
130};
131
132
133
134#endif
Matrix< std::complex< double >, N > CMatrix
Objet représentant les matrices carrées complexe de dimension N.
Definition CMatrix.hpp:15
#define CONSTEXPR
Utilisé pour utiliser ou non constexpr.
Definition Constexpr.hpp:7
constexpr CMatrix< 8 > MATRIX_SQRT_ISWAP_8
Definition Unitary.hpp:64
constexpr CMatrix< 32 > MATRIX_SPLIT_SLIDE
Definition Unitary.hpp:106
constexpr CMatrix< 8 > MATRIX_MERGE
Definition Unitary.hpp:92
CONSTEXPR CMatrix< 32 > MATRIX_MERGE_SLIDE
Definition Unitary.hpp:119
constexpr CMatrix< 8 > MATRIX_SLIDE
Definition Unitary.hpp:36
constexpr CMatrix< 4 > MATRIX_JUMP
Definition Unitary.hpp:33
constexpr CMatrix< 4 > MATRIX_ISWAP
Definition Unitary.hpp:12
constexpr CMatrix< 4 > MATRIX_SQRT_ISWAP
Definition Unitary.hpp:23
constexpr CMatrix< 8 > MATRIX_ISWAP_8
Definition Unitary.hpp:50
constexpr CMatrix< 8 > MATRIX_SPLIT
Definition Unitary.hpp:78