Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
donghufeng committed Jul 28, 2023
1 parent 52f73b1 commit d196c66
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 304 deletions.
1 change: 0 additions & 1 deletion .cppcheck.suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ noValidConfiguration:tests/decompositions/test_apply_atoms.cpp


preprocessorErrorDirective:ccsrc/include/config/details/cxx20_compatibility.h
preprocessorErrorDirective:ccsrc/python/core/include/python/details/define_binary_operator_helpers.h
preprocessorErrorDirective:tests/decompositions/test_apply_atoms.cpp
preprocessorErrorDirective:tests/ops/test_angle_parametric_gates.cpp
unusedStructMember:ccsrc/include/math/tensor/ops_cpu/utils.h
Expand Down
1 change: 0 additions & 1 deletion .jenkins/check/config/filter_cppcheck.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@


"mindquantum/ccsrc/include/config/details/cxx20_compatibility.h" "preprocessorErrorDirective"
"mindquantum/ccsrc/python/core/include/python/details/define_binary_operator_helpers.h" "preprocessorErrorDirective"
"mindquantum/tests/decompositions/test_apply_atoms.cpp" "preprocessorErrorDirective"
"mindquantum/tests/ops/test_angle_parametric_gates.cpp" "preprocessorErrorDirective"

Expand Down
1 change: 1 addition & 0 deletions .whitelizard.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ mindquantum/third_party/unitary_cc.py:uccsd_singlet_generator
mindquantum/io/display/circuit_text_drawer.py:brick_model
mindquantum/core/parameterresolver/parameterresolver.py:__init__
mindquantum/algorithm/compiler/decompose/universal_decompose/two_qubit_decompose.py:kak_decompose
mindquantum/simulator/mqsim.py:get_expectation_with_grad.grad_ops

ccsrc/include/ops/gates.h:mindquantum::GetGateByName
ccsrc/include/ops/gates/qubit_operator.tpp:mindquantum::ops::QubitOperator<coeff_t>::sparse_matrix
Expand Down
1 change: 0 additions & 1 deletion ccsrc/python/core/include/python/details/CPPLINT.cfg

This file was deleted.

104 changes: 0 additions & 104 deletions ccsrc/python/core/include/python/details/create_from_container_class.h

This file was deleted.

This file was deleted.

This file was deleted.

8 changes: 0 additions & 8 deletions ccsrc/python/mqbackend/lib/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,11 @@
#include "ops/hamiltonian.h"

#include "python/core/sparse/csrhdmatrix.h"
#include "python/details/create_from_container_class.h"
#include "python/details/define_binary_operator_helpers.h"
#include "python/ops/basic_gate.h"
#include "python/ops/build_env.h"

namespace py = pybind11;

// using mindquantum::sparse::Csr_Plus_Csr;
// using mindquantum::sparse::GetPauliMat;
// using mindquantum::sparse::PauliMat;
// using mindquantum::sparse::PauliMatToCsrHdMatrix;
// using mindquantum::sparse::SparseHamiltonian;
// using mindquantum::sparse::TransposeCsrHdMatrix;
using namespace pybind11::literals; // NOLINT(build/namespaces_literals)

namespace mindquantum::python {
Expand Down
6 changes: 4 additions & 2 deletions mindquantum/simulator/mqsim.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,10 @@ def get_expectation_with_grad( # pylint: disable=R0912,R0913,R0914,R0915
_check_input_type("circ_right", Circuit, circ_right)
if circ_right.is_noise_circuit and "mqvector" in self.name:
if circ_left is not None or simulator_left is not None:
raise ValueError("noise circuit use parameter shift rule to get grad, \
which not support circ_left and simulator_left.")
raise ValueError(
"noise circuit use parameter shift rule to get grad, \
which not support circ_left and simulator_left."
)
pr_shift = True
if pr_shift and "mqvector" not in self.name:
raise ValueError(f"{self.name} simulator not support parameter-shift rule.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import pytest
from scipy.stats import unitary_group

from mindquantum.core.circuit import Circuit
from mindquantum.core import gates
from mindquantum.algorithm.compiler import decompose
from mindquantum.core import gates
from mindquantum.core.circuit import Circuit

rand_unitary = unitary_group.rvs

Expand Down

0 comments on commit d196c66

Please sign in to comment.