`compiler_isa_to_target_quantum_processor` calls the deprecated `CompilerISA.dict()`, warning on every compile

Open Beginner friendly
#1,881 0 comments 0 reactions 0 assignees View on GitHub

@Goldloli is already working on this.

Since Nov 22, 2026.

  • #1898 by @Goldloli — open

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
85/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start in pyquil/external/rpcq.py at line 325, where compiler_isa.dict(by_alias=True) is called. The issue reports that this emits a deprecation warning during QVM compilation and that _dict(by_alias=True) returns the same value without the warning. Verify the behavior with the reproduction under -W error::DeprecationWarning; done means compilation no longer raises that warning.

Written by the indexing model from the issue text.

Description

Pre-Report Checklist

  • I am running the latest versions of pyQuil and the Forest SDK
  • I checked to make sure that this bug has not already been reported

Issue Description
pyquil/external/rpcq.py line 325 calls compiler_isa.dict(by_alias=True). CompilerISA.dict() is deprecated by pyQuil itself (@deprecated, "No longer requires serialization of RPCQ objects and is dropping Pydantic as a dependency.") and only forwards to _dict(by_alias=...). So every qc.compile(...) against a QVM emits a DeprecationWarning from inside pyQuil, which users can't act on. It shows under pytest and -W default, and with -W error::DeprecationWarning the compile fails. The same line is in 4.21.0, on master and in v5.0.0-rc.3. Similar to #1720.

How to Reproduce

# python -W default repro.py   (with qvm -S and quilc -R running)
from pyquil import Program, get_qc
from pyquil.gates import H, CNOT, MEASURE

qc = get_qc("2q-qvm")
p = Program(H(0), CNOT(0, 1))
ro = p.declare("ro", "BIT", 2)
p += MEASURE(0, ro[0]); p += MEASURE(1, ro[1])
p.wrap_in_numshots_loop(10)
qc.run(qc.compile(p))

Output:

.../pyquil/external/rpcq.py:325: DeprecationWarning: Call to deprecated method dict. (No longer requires
serialization of RPCQ objects and is dropping Pydantic as a dependency.) -- Deprecated since version 4.6.2.

With python -W error::DeprecationWarning repro.py, the same DeprecationWarning is raised and qc.compile(p) fails.

Suggested fix
TargetQuantumProcessor(isa=compiler_isa._dict(by_alias=True), specs={}). I checked that _dict(by_alias=True) returns the same value as dict(by_alias=True) with no warning. Happy to send the PR, with a changelog entry.

Environment Context
pyQuil 4.21.0 (same line on master and in v5.0.0-rc.3), Python 3.12.10, Windows 11; quilc and qvm from the rigetti/quilc and rigetti/qvm Docker images.

Found while building QObserva (local observability for quantum programs); its pyQuil tests surface this warning.

Dominant language
Python
Stars
1.5k
Forks
366
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rigetti/pyquil

All issues in rigetti/pyquil

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.