Skip to content

Commit

Permalink
Support u3 gate application
Browse files Browse the repository at this point in the history
  • Loading branch information
ibm-wakizaka committed Jul 18, 2023
1 parent a598075 commit 8712e5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contrib/runtime/aer_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@ 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

0 comments on commit 8712e5c

Please sign in to comment.