Required prerequisites
Describe the bug
The sampling of a circuit with a single qubit returns a result with a bitstring with two bits.
Steps to reproduce the bug
Compile the following circuit in library mode:
#include <cudaq.h>
#include <iostream>
void bar() __qpu__ {
cudaq::qubit a;
cudaq::x(a);
auto a0 = cudaq::mz(a);
cudaq::reset(a);
auto a1 = cudaq::mz(a);
}
int main() {
std::cout << "Bar:\n";
auto result = cudaq::sample(bar);
result.dump();
return 0;
}
It's execution returns:
Note: this problem seems to not happen when we add a quantum operator after the reset.
Expected behavior
It should return:
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
- CUDA Quantum version: nvq++ proto-0.6.0 (main branch)
- C++ compiler: g++ 13.2.0
- Operating system: Ubuntu 23.10 (Docker container)
Suggestions
No response
Required prerequisites
Describe the bug
The sampling of a circuit with a single qubit returns a result with a bitstring with two bits.
Steps to reproduce the bug
Compile the following circuit in library mode:
It's execution returns:
Note: this problem seems to not happen when we add a quantum operator after the
reset.Expected behavior
It should return:
Is this a regression? If it is, put the last known working version (or commit) here.
Not a regression
Environment
Suggestions
No response