Parametrized Quantum Circuits for Reinforcement Learning stuck if using qsim backend
@mhucka がすでに取り組んでいます。
2026年6月5日 から。
評価
この issue はまだ評価されていません。
説明
I've ran this notebook with no problem. However, if I try to use qsim as a backend by passing the backend backend = qsimcirq.QSimSimulator() explicitly to ReUploadingPQC, then I get the following message
2023-04-26 09:20:03.862016: W tensorflow/core/grappler/optimizers/loop_optimizer.cc:907] Skipping loop optimization for Merge node with control input: cond/branch_executed/_12
and it gets stuck there indefinitely.
Any idea of what might be going on?
To reproduce:
replace
def generate_model_policy(
qubits: List[cirq.GridQubit],
n_layers: int,
n_actions: int,
beta: float,
observables: List[cirq.PauliString],
) -> tf.keras.Model:
"""Generates a Keras model for a data re-uploading PQC policy."""
input_tensor = tf.keras.Input(shape=(len(qubits),), dtype=tf.dtypes.float32, name="input")
re_uploading_pqc = ReUploadingPQC(qubits, n_layers, observables)([input_tensor])
process = tf.keras.Sequential(
[Alternating(n_actions), tf.keras.layers.Lambda(lambda x: x * beta), tf.keras.layers.Softmax()],
name="observables-policy",
)
policy = process(re_uploading_pqc)
model = tf.keras.Model(inputs=[input_tensor], outputs=policy)
return model
with
def generate_model_policy(
qubits: List[cirq.GridQubit],
n_layers: int,
n_actions: int,
beta: float,
observables: List[cirq.PauliString],
backend="noiseless",
) -> tf.keras.Model:
"""Generates a Keras model for a data re-uploading PQC policy."""
input_tensor = tf.keras.Input(shape=(len(qubits),), dtype=tf.dtypes.float32, name="input")
re_uploading_pqc = ReUploadingPQC(qubits, n_layers, observables, backend=backend)([input_tensor])
process = tf.keras.Sequential(
[Alternating(n_actions), tf.keras.layers.Lambda(lambda x: x * beta), tf.keras.layers.Softmax()],
name="observables-policy",
)
policy = process(re_uploading_pqc)
model = tf.keras.Model(inputs=[input_tensor], outputs=policy)
return model
and then replace
model = generate_model_policy(qubits, n_layers, n_actions, 1.0, observables)
backend = qsimcirq.QSimSimulator()
model = generate_model_policy(qubits, n_layers, n_actions, 1.0, observables, backend=backend)
versions:
gym = "==0.22.0"
tensorflow = "2.7.0"
tensorflow-quantum = "0.7.2"
qsimcirq = "0.13.3" # <0.16.0 because of incompatibility with tensorflow-quantum
- 主要言語
- Python
- スター
- 2.2k
- フォーク
- 672
- 平均マージ
- 12時間 50分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
tensorflow/quantum のほかの issue
-
area/devops help wanted no QC knowledge needed priority/before-0.7.7
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
tensorflow/quantum#1082 · コメント 2 件 · リアクション 1 件 ·
-
Support Keras 3再び着手できるかも @rosspeili が 93 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンarea/keras help wanted skill-level/intermediate
tensorflow/quantum#1090 · コメント 5 件 · 担当者 1 名 ·
-
Investigate support for JAX再び着手できるかも @bug-catcher が 41 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンskill-level/expert
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
tensorflow/quantum#1089 · コメント 2 件 ·
-
area/core priority/after-0.7.7 skill-level/expert
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
tensorflow/quantum#1088 ·
-
area/circuits priority/after-0.7.7 skill-level/expert
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
tensorflow/quantum#1087 ·
tensorflow/quantum の issue をすべて見る
似ている issue
-
bug needs-triage priority:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
yeongseon/azure-functions-logging-python#583 ·
メンテナーはふだん 1 日以内に返信
-
documentation needs-triage priority:medium
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
yeongseon/azure-functions-validation-python#546 ·
メンテナーはふだん 1 日以内に返信
-
PHP workflow streaming requests buffer the full SSE response対応中かも @Winoren が今日担当しました。 オープンreview: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
langgenius/dify#44270 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
P4: low
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
jeffknupp/association#523 ·
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
DarkStarSystems/pcons#229 ·
メンテナーはふだん 1 日以内に返信