pyquil_to_cirq fails on PSWAP with a symbolic parameter

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

メンテナーはふだん 1 日以内に返信

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
73/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
numpy, python

調査の方向性

Start in qbraid/transpiler/conversions/pyquil/cirq_quil_input.py at pswap() and compare its symbolic-parameter handling with the parameterized RX and CPHASE00 conversions. Reproduce with the issue's DECLARE theta REAL example, then verify that the resulting Cirq circuit resolves theta with cirq.resolve_parameters and that numeric PSWAP still works.

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

説明

Problem

Converting a pyQuil program to Cirq fails when PSWAP takes a declared (symbolic) parameter. pswap() in qbraid/transpiler/conversions/pyquil/cirq_quil_input.py builds its matrix with np.exp(1j * phi), and that fails on a sympy expression. A numeric PSWAP(0.5) works, and other parameterized gates (RX(theta), CPHASE00(theta)) accept symbols.

from qbraid.transpiler.conversions.pyquil.cirq_quil_input import circuit_from_quil

circuit_from_quil("DECLARE theta REAL\nPSWAP(theta) 0 1")
TypeError: loop of ufunc does not support argument 0 of type Mul which has no callable exp method
Expected

A Cirq circuit with a parameterized PSWAP that cirq.resolve_parameters(circuit, {"theta": ...}) can resolve, as for RX(theta).

主要言語
Python
スター
117
フォーク
66
平均マージ
1日 10時間
マージ済み PR(30日)
22

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

qBraid/qBraid のほかの issue

qBraid/qBraid の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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