Skip to content

Bug in cudaq.exp_pauli for quantum devices (Python) #2671

@bmhowe23

Description

@bmhowe23

Required prerequisites

  • Consult the security policy. If reporting a security vulnerability, do not report the bug using this form. Use the process described in the policy to report the issue.
  • Make sure you've read the documentation. Your issue may be addressed there.
  • Search the issue tracker to verify that this hasn't already been reported. +1 or comment there if it has.
  • If possible, make a PR with a failing test to give us a starting point to work on!

Describe the bug

This is similar to #2222

There are still some exp_pauli use cases in Python that do not lower to quantum hardware correctly.

Steps to reproduce the bug

Use the python/tests/kernel/test_kernel_exp_pauli.py file in the repo ... add the following statements to the bottom of it.

cudaq.set_target('quantinuum', emulate=True)
# This works
test_exp_pauli()
print('test_exp_pauli works')
# This fails
test_exp_pauli_param()
print('never gets here')

When run like the following, it produces this error:

$ python3 python/tests/kernel/test_kernel_exp_pauli.py
test_exp_pauli works
error: 'quake.exp_pauli' op cannot determine pauli word string
error: failed to legalize operation 'quake.exp_pauli'
RuntimeError: Remote rest platform Quake lowering failed.

Expected behavior

Lowering to quantum hardware should work just like the simulation use case.

Is this a regression? If it is, put the last known working version (or commit) here.

Not a regression

Environment

  • CUDA-Q version: latest (22ffd96 as of the time of this writing)
  • Python version: 3.10
  • C++ compiler: N/A
  • Operating system:

Suggestions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions