-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add batch update #191
Add batch update #191
Conversation
…, add batched control test
…bablistic's batch update
src/gate/gate.cpp
Outdated
std::uint64_t full_mask = (1ULL << states.n_qubits()) - 1; | ||
if ((_target_mask | _control_mask) > full_mask) [[unlikely]] { | ||
throw std::runtime_error( | ||
"Error: Gate::update_quantum_state(StateVector& state): " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
エラーメッセージは StateVectorBached& state ですかね
src/state/state_vector.cpp
Outdated
@@ -11,6 +11,9 @@ StateVector<Fp>::StateVector(std::uint64_t n_qubits) | |||
set_zero_state(); | |||
} | |||
FLOAT(Fp) | |||
StateVector<Fp>::StateVector(Kokkos::View<ComplexType*> view) | |||
: _dim(view.extent(0)), _raw(view), _n_qubits(std::bit_width(_dim) - 1) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++のコンストラクタでのメンバの初期化についてなんですが,メンバを宣言した順番に走るので,
_n_qubits
, _dim
, _raw
の順で初期化されることになります.なのでこのままだと _n_qubits(std::bit_width(_dim) - 1)
が不定値になると思います
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
その他 warning の解消もお願いします!
https://github.com/qulacs/scaluq/actions/runs/12424606202/job/34690035129
…ds for BatchedStateVector, reorder constructor of StateVector(Kokkos::View<ComplexType*> view)
add batchを精度指定に対応しました。
先にStateVectorBatchedのマージをして、cirquitの配列を受け取るのは別ブランチでやります。