Hamiltonian expectation value in one call

オープン
#18 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
python, rust

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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).
主要言語
Rust
スター
1
フォーク
0
平均マージ
12分
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kaiwave/qsengine のほかの issue

kaiwave/qsengine の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。