Skip to content
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

Merged
merged 23 commits into from
Dec 27, 2024
Merged

Add batch update #191

merged 23 commits into from
Dec 27, 2024

Conversation

Glacialte
Copy link
Contributor

add batchを精度指定に対応しました。
先にStateVectorBatchedのマージをして、cirquitの配列を受け取るのは別ブランチでやります。

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): "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

エラーメッセージは StateVectorBached& state ですかね

@@ -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) {}
Copy link
Contributor

@gandalfr-KY gandalfr-KY Dec 24, 2024

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) が不定値になると思います

Copy link
Contributor

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)
@Glacialte Glacialte merged commit c2ed057 into main Dec 27, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants