Skip to content

Commit

Permalink
Support u3 gate application in Aer runtime API (Qiskit#1876)
Browse files Browse the repository at this point in the history
* Support u3 gate application

* Apply clang-format

* Revert clang-format for aer_runtime_api.h

* Add release note

---------

Co-authored-by: Hiroshi Horii <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored and doichanj committed Aug 9, 2023
1 parent 67e6e8d commit 8885eae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
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`

0 comments on commit 8885eae

Please sign in to comment.