We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
template<typename T, typename … ARGS> std::vector<T> cudaq::run( size_t shots, std::function<T(ARGS…)>&& kernel, ARGS…);
__qpu__ bool kernel(int n) { cudaq::qvector q(n); x(q[0]); return mz(q[0]); } int main() { auto results = cudaq::run<bool>(/*shots=*/1000, kernel, 2); std::cout << results << std::endl; }
Output: [1,1, ... 1] // 1000 results
[1,1, ... 1] // 1000 results
Currently we would like to support returning the following types:
bool int float double std::vector<bool> // For measurements of qvectors (const size after opts) structs of elements above (next version)
@cudaq.kernel() def kernel(n: int): bool q = cudaq.qvector(n) x(q[0]) return mz(q[0]) results = cudaq.run(shots=1000, kernel, 2) print(results)
bool int np.float32 np.float64 list[bool] // For measurements of qvectors (const size after opts) structs of elements above (next version)
Idea:
struct OutputRecord { void* ptr; std::size_t byteSize; }; class OutputParser { virtual std::vector<OutputRecord> parse(std::istream& s); };
cudaq::run
cudaq.run
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Required prerequisites
Describe the feature
Implement cudaq::run API
Examples (c++)
Output:
[1,1, ... 1] // 1000 results
Currently we would like to support returning the following types:
Examples (python)
Output:
[1,1, ... 1] // 1000 results
Currently we would like to support returning the following types:
Tasks
Idea:
cudaq::run
API in c++cudaq.run
API in PythonThe text was updated successfully, but these errors were encountered: