Skip to content
New issue

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

Store AceCR properties in self.params #952

Merged
merged 3 commits into from
May 30, 2024
Merged

Store AceCR properties in self.params #952

merged 3 commits into from
May 30, 2024

Conversation

dowusu-antwi
Copy link
Contributor

@dowusu-antwi dowusu-antwi commented May 21, 2024

Fixes #953 compilation error:

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.

@richrines1
Copy link
Contributor

failing test should be fixed by #954

Copy link
Contributor

@richrines1 richrines1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % nit

qiskit-superstaq/qiskit_superstaq/custom_gates.py Outdated Show resolved Hide resolved
dowusu-antwi and others added 2 commits May 30, 2024 12:00
Co-authored-by: richrines1 <85512171+richrines1@users.noreply.github.com>
@dowusu-antwi dowusu-antwi merged commit 94415c1 into main May 30, 2024
19 checks passed
@dowusu-antwi dowusu-antwi deleted the compile-bound branch May 30, 2024 20:24
stephanielee9 added a commit that referenced this pull request May 31, 2024
Will wait for #952 to
go in
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bound parametric circuits don't compile
3 participants