Skip to content

Commit

Permalink
change static_cast to nb::overload_cast
Browse files Browse the repository at this point in the history
  • Loading branch information
Glacialte committed Jan 24, 2025
1 parent 6374e88 commit 8258a26
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/scaluq/circuit/circuit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ void bind_circuit_circuit_hpp(nb::module_& m) {
nb::overload_cast<const Circuit<Fp>&>(&Circuit<Fp>::add_circuit),
"Add all gates in specified circuit. Given gates are copied.")
.def("update_quantum_state",
static_cast<void (Circuit<Fp>::*)(StateVector<Fp>&, const std::map<std::string, Fp>&)
const>(&Circuit<Fp>::update_quantum_state),
nb::overload_cast<StateVector<Fp>&, const std::map<std::string, Fp>&>(
&Circuit<Fp>::update_quantum_state, nb::const_),
"Apply gate to the StateVector. StateVector in args is directly updated. If the "
"circuit contains parametric gate, you have to give real value of parameter as "
"dict[str, float] in 2nd arg.")
Expand All @@ -149,9 +149,9 @@ void bind_circuit_circuit_hpp(nb::module_& m) {
"\"name=value\" format in kwargs.")
.def(
"update_quantum_state",
static_cast<void (Circuit<Fp>::*)(StateVectorBatched<Fp>&,
const std::map<std::string, std::vector<Fp>>&) const>(
&Circuit<Fp>::update_quantum_state),
nb::overload_cast<StateVectorBatched<Fp>&,
const std::map<std::string, std::vector<Fp>>&>(
&Circuit<Fp>::update_quantum_state, nb::const_),
"Apply gate to the StateVectorBatched. StateVectorBatched in args is directly updated. "
"If the circuit contains parametric gate, you have to give real value of parameter as "
"dict[str, list[float]] in 2nd arg.")
Expand Down

0 comments on commit 8258a26

Please sign in to comment.