@@ -59,7 +59,6 @@ namespace simulator
5959 static void apply_theta_gate (complex (&__s)[1 << n_qubits], const gate_type &__g_type, const double &__theta, const std::size_t &qubit_target);
6060 static void apply_2qubit_gate (complex (&__s)[1 << n_qubits], const gate_type &__g_type, const std::size_t &q_control, const std::size_t &q_target);
6161
62- private:
6362 // a vector-space (hilbert-space) defined over complex numbers C
6463 // 1 << n_qubit translates to 2^N, where N is the number of qubit the hilbert-space(quantum-system) supports
6564 // memory consumption on x86_64 architecture for N-qubit system is: f(N) = 16 * 2^abs(N) bytes, that is exponential growth
@@ -127,17 +126,17 @@ namespace simulator
127126 break ;
128127
129128 case gate_type::ROTATION_X:
130- __g.matrix [0 ][0 ] = std::__complex_cos <double >(__theta / 2.0 );
131- __g.matrix [0 ][1 ] = (complex ){0.0 , -1.0 } * std::__complex_sin <double >(__theta / 2.0 );
132- __g.matrix [1 ][0 ] = (complex ){0.0 , -1.0 } * std::__complex_sin <double >(__theta / 2.0 );
133- __g.matrix [1 ][1 ] = std::__complex_cos <double >(__theta / 2.0 );
129+ __g.matrix [0 ][0 ] = std::cos <double >(__theta / 2.0 );
130+ __g.matrix [0 ][1 ] = (complex ){0.0 , -1.0 } * std::sin <double >(__theta / 2.0 );
131+ __g.matrix [1 ][0 ] = (complex ){0.0 , -1.0 } * std::sin <double >(__theta / 2.0 );
132+ __g.matrix [1 ][1 ] = std::cos <double >(__theta / 2.0 );
134133 break ;
135134
136135 case gate_type::ROTATION_Y:
137- __g.matrix [0 ][0 ] = std::__complex_cos <double >(__theta / 2.0 );
138- __g.matrix [0 ][1 ] = -std::__complex_sin <double >(__theta / 2.0 );
139- __g.matrix [1 ][0 ] = std::__complex_sin <double >(__theta / 2.0 );
140- __g.matrix [1 ][1 ] = std::__complex_cos <double >(__theta / 2.0 );
136+ __g.matrix [0 ][0 ] = std::cos <double >(__theta / 2.0 );
137+ __g.matrix [0 ][1 ] = -std::sin <double >(__theta / 2.0 );
138+ __g.matrix [1 ][0 ] = std::sin <double >(__theta / 2.0 );
139+ __g.matrix [1 ][1 ] = std::cos <double >(__theta / 2.0 );
141140 break ;
142141
143142 case gate_type::ROTATION_Z:
0 commit comments