Skip to content

Commit

Permalink
all test has passed on CPU!
Browse files Browse the repository at this point in the history
  • Loading branch information
KowerKoint authored and KowerKoint committed Feb 7, 2025
1 parent 99437dc commit cbcddd2
Show file tree
Hide file tree
Showing 8 changed files with 243 additions and 276 deletions.
2 changes: 1 addition & 1 deletion include/scaluq/gate/merge_gate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace scaluq {
template <Precision Prec>
inline std::pair<Gate<Prec>, double> merge_gate(const Gate<Prec>& gate1, const Gate<Prec>& gate2);
std::pair<Gate<Prec>, double> merge_gate(const Gate<Prec>& gate1, const Gate<Prec>& gate2);

#ifdef SCALUQ_USE_NANOBIND
namespace internal {
Expand Down
2 changes: 1 addition & 1 deletion include/scaluq/gate/param_gate_factory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ inline ParamGate<Prec> ParamPauliRotation(const PauliOperator<Prec>& pauli,
double param_coef = 1.,
const std::vector<std::uint64_t>& controls = {}) {
return internal::ParamGateFactory::create_gate<internal::ParamPauliRotationGateImpl<Prec>>(
internal::vector_to_mask(controls), pauli, static_cast < internal::Float<Prec>(param_coef));
internal::vector_to_mask(controls), pauli, static_cast<internal::Float<Prec>>(param_coef));
}
template <Precision Prec>
inline ParamGate<Prec> ParamProbablistic(
Expand Down
3 changes: 0 additions & 3 deletions src/gate/merge_gate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ std::pair<Gate<Prec>, double> merge_gate_dense_matrix(const Gate<Prec>& gate1,
gate2->target_qubit_list(),
gate2->control_qubit_mask() & ~common_control_mask,
merged_operand_vector);
std::cerr << matrix1 << std::endl;
std::cerr << matrix2 << std::endl;
auto matrix = matrix2 * matrix1;
std::cerr << matrix << std::endl;
return {gate::DenseMatrix<Prec>(
merged_operand_vector, matrix, internal::mask_to_vector(common_control_mask)),
0.};
Expand Down
9 changes: 4 additions & 5 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ cmake_minimum_required(VERSION 3.21)
enable_testing()

add_executable(scaluq_test EXCLUDE_FROM_ALL
#circuit/circuit_test.cpp
#circuit/param_circuit_test.cpp
circuit/circuit_test.cpp
circuit/param_circuit_test.cpp
gate/gate_test.cpp
gate/batched_gate_test.cpp
# gate/merge_test.cpp
#gate/merge_test.cpp
#gate/param_gate_test.cpp
gate/merge_test.cpp
gate/param_gate_test.cpp
operator/test_pauli_operator.cpp
operator/test_operator.cpp
state/state_vector_test.cpp
Expand Down
Loading

0 comments on commit cbcddd2

Please sign in to comment.