Skip to content

Controlled exp_pauli is not working #2822

@psm-optimizes

Description

@psm-optimizes

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

  1. I want to use the controlled version of exp_pauli to apply the Hamiltonian simulation of the coefficient matrix of a linear system of equations as a part of a HHL-type algorithm.
  2. Throughout the circuit, I call the controlled exp_pauli in a for loop to apply the Hamiltonian controlled by different cubits.
  3. The error I get is as follows:
    error: 'quake.extract_ref' op invalid constant index value
    RuntimeError Traceback (most recent call last)
    Cell In[17], line 3
    1 # Draw the quantum circuit
    2 print("============================== Circuit structure ============================== \n")
    ----> 3 print(cudaq.draw(GQLSS, b, eigs, r_choice, 2*np.pi, coefficients, words))

RuntimeError: cudaq::builder failed to JIT compile the Quake representation.

Steps to reproduce the bug

The code is available here.

Expected behavior

The circuit should be drawn.

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

Not a regression

Environment

  • CUDA-Q version: 0.10.0
  • Python version: 3.11.8
  • C++ compiler:
  • Operating system: Linux blue2 5.10.0-20-amd64

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