We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
After a parametric circuit's parameters are bound, it's no longer parametric, but Superstaq tells users it still is.
import qiskit_superstaq as qss provider = qss.SuperstaqProvider() brisbane = provider.get_backend("ibmq_brisbane_qpu") theta = qiskit.circuit.Parameter("θ") qc = qiskit.QuantumCircuit(2, 2) qc.append(qss.AceCR(theta), (0, 1)) qc.measure((0, 1), (0, 1)) # ┌───────────┐┌─┐ # q_0: ┤0 ├┤M├─── # │ Acecr(θ) │└╥┘┌─┐ # q_1: ┤1 ├─╫─┤M├ # └───────────┘ ║ └╥┘ # c: 2/══════════════╩══╩═ # 0 1 qc_bound = qc.assign_parameters({theta: np.pi / 3}) # ┌─────────────┐┌─┐ # q_0: ┤0 ├┤M├─── # │ Acecr(π/3) │└╥┘┌─┐ # q_1: ┤1 ├─╫─┤M├ # └─────────────┘ ║ └╥┘ # c: 2/════════════════╩══╩═ # 0 1 brisbane.compile(qc_bound) # SuperstaqServerException: Can't convert parameterized unbounded qiskit circuits. Please let us know if you'd like this feature # (Status code: 400, non-retriable error making request to Superstaq API)
Bound circuits should be compiled with no issues.
brisbane.compile(qc_bound) # This should work. # C. f. working example, hard-coded parameter: qc_hard_coded = qiskit.QuantumCircuit(2, 2) qc_hard_coded.append(qss.AceCR(np.pi/3), (0, 1)) qc_hard_coded.measure((0, 1), (0, 1)) # ┌─────────────┐┌─┐ # q_0: ┤0 ├┤M├─── # │ Acecr(π/3) │└╥┘┌─┐ # q_1: ┤1 ├─╫─┤M├ # └─────────────┘ ║ └╥┘ # c: 2/════════════════╩══╩═ # 0 1 brisbane.compile(qc_hard_coded) # This works.
FWIW, Qiskit treats a bound parameterized circuit and a circuit with hard-coded parameters differently (which I don't think was always true):
qc_bound == qc_hard_coded # This returns False.
Note: duplicate of server-side issue
The text was updated successfully, but these errors were encountered:
AceCR
self.params
Store AceCR properties in self.params (#952)
94415c1
Fixes #953 compilation error: ```python import qiskit_superstaq as qss provider = qss.SuperstaqProvider() brisbane = provider.get_backend("ibmq_brisbane_qpu") theta = qiskit.circuit.Parameter("θ") qc = qiskit.QuantumCircuit(2, 2) qc.append(qss.AceCR(theta), (0, 1)) qc.measure((0, 1), (0, 1)) # ┌───────────┐┌─┐ # q_0: ┤0 ├┤M├─── # │ Acecr(θ) │└╥┘┌─┐ # q_1: ┤1 ├─╫─┤M├ # └───────────┘ ║ └╥┘ # c: 2/══════════════╩══╩═ # 0 1 qc_bound = qc.assign_parameters({theta: np.pi / 3}) # ┌─────────────┐┌─┐ # q_0: ┤0 ├┤M├─── # │ Acecr(π/3) │└╥┘┌─┐ # q_1: ┤1 ├─╫─┤M├ # └─────────────┘ ║ └╥┘ # c: 2/════════════════╩══╩═ # 0 1 brisbane.compile(qc_bound) # In `main`: # SuperstaqServerException: Can't convert parameterized unbounded qiskit circuits. Please let us know if you'd like this feature # (Status code: 400, non-retriable error making request to Superstaq API) # In `compile-bound`: No exception raised. ``` --------- Co-authored-by: richrines1 <85512171+richrines1@users.noreply.github.com>
Successfully merging a pull request may close this issue.
What is happening?
After a parametric circuit's parameters are bound, it's no longer parametric, but Superstaq tells users it still is.
How can we reproduce the issue?
What should happen?
Bound circuits should be compiled with no issues.
FWIW, Qiskit treats a bound parameterized circuit and a circuit with hard-coded parameters differently (which I don't think was always true):
Environment
Any additional context?
Note: duplicate of server-side issue
The text was updated successfully, but these errors were encountered: