Faster CPU backend for large registers (≥ 20 qubits)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- performance
Hướng nghiên cứu
Start with apply_gate_kernel in src/engine.rs around line 75 and compare its CPU benchmark with Qiskit Aer at 20 or more qubits. The issue lists gate special cases, controlled-gate indexing, cache blocking, and two-qubit fusion as possible optimization paths. Done means CPU circuits run faster without an API change; the issue names no benchmark file or test command.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What you want to do
In the benchmark the CPU backend falls behind Qiskit Aer from 20 qubits (1.17 s vs 431 ms at 22). Each extra qubit costs 3–4× instead of 2× once the 16 MiB state stops fitting in L3 cache. Users without a GPU hit this wall first.
Implementation notes
Ranked roughly by expected gain per line of code:
- Special-case permutation and diagonal gates.
apply_gate_kernel(src/engine.rs:75) runs a
full 2×2 complex multiply for X, CX, Z, CZ, S, T, P and RZ. X and CX only need to swap amplitudes.
Diagonal gates only need to multiply one half (or both halves by a phase). This halves the
arithmetic and the memory writes for diagonal gates. - Controlled gates should only visit pairs whose control bits are set. At the moment the kernel
visits every pair and skips non-matching ones with a branch. Enumerating only the indices that
match turns a full pass into half a pass (CX) or a quarter (CCX). - Cache blocking. Apply runs of gates whose targets are all below some qubit k to one
2^k-amplitude block at a time, so each block stays in L2/L3 while several gates hit it. - Two-qubit fusion. Merge consecutive gates on the same pair of qubits into one 4×4 matrix.
That needs a 4×4 kernel.
What it could look like
No API change: the same circuits just run faster on `backend="cpu"`.
Contributing
- I would like to open a pull request for this (see CONTRIBUTING.md).
- Ngôn ngữ chính
- Rust
- Star
- 1
- Fork
- 0
- Merge trung bình
- 12 phút
- Pull request đã merge (30 ngày)
- 4
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của kaiwave/qsengine
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
-
Fold long circuit drawingsĐang mởenhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Tất cả issue của kaiwave/qsengine
Issue tương tự
-
bug order-flow studies ui
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
userFRM/egui-charts#2417 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
In a plain-text message, Font, Font Size, Font Color and Text Highlight Color stay liveCó thể đã có người làm @ragelfundionctrumnar đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
UCS-Care-Group/mailcraft#862 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
smoltcp-rs/smoltcp#1243 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày