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

Qedma function fails on simple 12Q circuit #27

Open
nonhermitian opened this issue Nov 4, 2024 · 1 comment
Open

Qedma function fails on simple 12Q circuit #27

nonhermitian opened this issue Nov 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nonhermitian
Copy link

Steps to reproduce the problem

N = 12
qc = QuantumCircuit(N)

qc.x(range(N))
qc.h(range(N))

for kk in range(N // 2, 0, -1):
    qc.ch(kk, kk - 1)
for kk in range(N // 2, N - 1):
    qc.ch(kk, kk + 1)

op = SparsePauliOp('Z'*12)

qesem_function  = catalog.load('qedma/qesem')

qesem_job = qesem_function.run(
    backend_name=backend.name,
    action = "execute",
    instance = backend._instance,
    pubs = pubs,
)

What is the current behavior?

It fails with

{'error': 'An unexpected error occurred. Please try again later. If the issue persists, please contact support.'}

What is the expected behavior?

It should work because it is a standard input that works on other functions like the IBM circuit function

@nonhermitian nonhermitian added the bug Something isn't working label Nov 4, 2024
@johannesgreiner
Copy link

for reference, the underlying cause of the failure seems to be that the construction of the PUB should allow single observables outside of an array. This example works:

qc = QuantumCircuit(12)

qc.x(range(12))
qc.h(range(12))

for kk in range(12 // 2, 0, -1):
    qc.ch(kk, kk - 1)
for kk in range(12 // 2, 12 - 1):
    qc.ch(kk, kk + 1)

op = SparsePauliOp('Z'*12)

pubs = [(qc, [op])]

options = {
    "default_precision": 0.1,
    "execution_mode": "batch",
}
   
# Run the function
job = qesem_function.run(
   pubs=pubs,
   instance=IQP_INSTANCE,
   backend_name = BACKEND,
   options=options,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants