Skip to content

Commit

Permalink
Add a hacky workaround for python. Python needs to use the new argument
Browse files Browse the repository at this point in the history
synthesis, but it is still using the old quake synthesis compiler pass.
  • Loading branch information
schweitzpgi committed Sep 18, 2024
1 parent 3016fa7 commit e8cef22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/tests/kernel/test_adjoint_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def sdg_1_state_negate():

# Place qubit in 1-state.
x(qubit)
# Superpositoin.
# Superposition.
h(qubit)
# Rotate around Z by -pi/2, twice. Total rotation of -pi.
sdg(qubit)
Expand Down
6 changes: 5 additions & 1 deletion runtime/common/BaseRemoteRESTQPU.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,11 @@ class BaseRemoteRESTQPU : public cudaq::QPU {
"cudaq::observe(), or cudaq::draw().");

// Get the Quake code, lowered according to config file.
auto codes = lowerQuakeCode(kernelName, rawArgs);
// FIXME: For python, we reach here with rawArgs being empty and args having
// the arguments. Python should be using the streamlined argument synthesis,
// but apparently it isn't. This works around that bug.
auto codes = rawArgs.empty() ? lowerQuakeCode(kernelName, args)
: lowerQuakeCode(kernelName, rawArgs);
completeLaunchKernel(kernelName, std::move(codes));
}

Expand Down

0 comments on commit e8cef22

Please sign in to comment.