-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
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
[StateHandling] Implement custatevec state initialization from state vector in device memory #1788
Comments
As discussed, the API currently prevents any scenario that would require this support. We hence will just make it a clean error. We'll likely need to come back to it when we expand the API e.g. to integrate with other GPU-accelerated packages. |
I might be missing something, but why does the API prevent this scenario? I thought this was possible today, and if so we need an error or an implementation thrust::host_vector<thrust::complex<double>> hostVector(4);
hostVector[0] = M_SQRT1_2;
hostVector[3] = M_SQRT1_2;
thrust::device_vector<thrust::complex<double>> devState = hostVector;
auto *devPtr = thrust::raw_pointer_cast(&devState[0]);
auto deviceState = cudaq::state::from_data(
std::make_pair(reinterpret_cast<std::complex<double> *>(devPtr), 4));
auto kernel = [](cudaq::state s) __qpu__ { cudaq::qvector q (s); };
cudaq::get_state(kernel, deviceState).dump() There's a test for the |
This is a somewhat 'stale' comment in this cuda-quantum/runtime/nvqir/custatevec/CuStateVecCircuitSimulator.cpp Lines 164 to 165 in f1768b2
From the current set of The other one below, Hence, I think we just need to clean up those obsolete comments and add a verification check about this assumption. |
Implement:
FIXME handle case where pointer is a device pointer
inCuStateVecCircuitSimulator::addQubitsToState
The text was updated successfully, but these errors were encountered: