Hamiltonian expectation value in one call

Đang mở
#18 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
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ệ
python, rust
Lĩnh vực
backend, performance

Hướng nghiên cứu

Start by locating the Rust code that parses Pauli terms and computes qc.expectation(terms), then trace how Python exposes that API. Check how terms are represented and how gradient() accepts inputs; the issue proposes a reusable PauliSum and sharing amplitude passes by flip mask. Done means a Hamiltonian object can be reused with expectation() and passed to gradient(), with the grouped computation described in the issue.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
What you want to do

coeffs @ qc.expectation(terms) works, but it builds an array of one value per term, and there's
no single object for a Hamiltonian that can be reused across calls or passed to gradient() (M3).

Implementation notes
  • Parse once in Rust. Terms with the same X/Y positions (the same flip mask) can share one pass
    over the amplitudes, which cuts passes from (number of terms) to (number of distinct flip masks).
    For example, all Z-only terms share one pass.
What it could look like
H = qsengine.PauliSum({"ZZI": 1.0, "IZZ": 1.0, "XII": -0.5})
qc.expectation(H)       # -> float
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

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của kaiwave/qsengine

Tất cả issue của kaiwave/qsengine

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.