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

Support u3 gate application in Aer runtime API #1876

Merged
merged 8 commits into from
Jul 27, 2023
Merged
7 changes: 7 additions & 0 deletions contrib/runtime/aer_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ complex_t *aer_release_statevector(void *handler) {
return sv.move_to_buffer();
};

// u3 gate
void aer_apply_u3(void *handler, uint_t qubit, double theta, double phi,
double lambda) {
AER::AerState *state = reinterpret_cast<AER::AerState *>(handler);
state->apply_u(qubit, theta, phi, lambda);
}

// phase gate
void aer_apply_p(void *handler, uint_t qubit, double lambda) {
AER::AerState *state = reinterpret_cast<AER::AerState *>(handler);
Expand Down
3 changes: 3 additions & 0 deletions contrib/runtime/aer_runtime_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ double complex aer_amplitude(void* state, uint_t outcome);
// returned pointer must be freed in the caller
double complex* aer_release_statevector(void* state);

// u3 gate
void aer_apply_u3(void* state, uint_t qubit, double theta, double phi, double lambda);

// phase gate
void aer_apply_p(void* state, uint_t qubit, double lambda);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
features:
- |
`aer_apply_u3` is added to `aer_runtime_api.h`
Loading