diff --git a/tests/gate/gate_test.cpp b/tests/gate/gate_test.cpp index 088e6d6e..d60755ec 100644 --- a/tests/gate/gate_test.cpp +++ b/tests/gate/gate_test.cpp @@ -914,7 +914,7 @@ void test_matrix_control(std::uint64_t n_qubits) { Eigen::Matrix, 2, 2, Eigen::RowMajor> U3 = get_eigen_matrix_random_one_target_unitary(); auto U = internal::kronecker_product(U3, internal::kronecker_product(U2, U1)); - internal::ComplexMatrix mat(U.rows(), U.cols()); + internal::ComplexMatrix mat = ComplexMatrix::Zero(U.rows(), U.cols()); for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { mat(i, j) = U(i, j);