Skip to content
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

New feature: getAmps #73

Open
TysonRayJones opened this issue Nov 29, 2018 · 1 comment
Open

New feature: getAmps #73

TysonRayJones opened this issue Nov 29, 2018 · 1 comment

Comments

@TysonRayJones
Copy link
Member

void getAmps(QubitRegister qureg, long long int startInd, long long int numAmps, REAL** reals, REAL**imags);

This mallocs two REAL lists (for the real and imaginary components) and populates them with amplitudes of the statevector in the given index range (startInd to startInd+numAmps).
In distributed mode, this involves a reduction.

Example use:

REAL *reals, *imags;
getAmps(qureg, 10, 500, &reals, &imags);
free(reals);
free(imags);

Alternatively, forcing the user to alloc (so that they may pass arrays) is ok too

@TysonRayJones
Copy link
Member Author

and the density matrix getDensityAmps of course

TysonRayJones added a commit that referenced this issue Dec 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant