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

Aer runtime api (from contrib) exposes the wrong sx operation #1925

Closed
aromanro opened this issue Sep 4, 2023 · 0 comments
Closed

Aer runtime api (from contrib) exposes the wrong sx operation #1925

aromanro opened this issue Sep 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@aromanro
Copy link
Contributor

aromanro commented Sep 4, 2023

Informations

  • Qiskit Aer version:

0.13.0 - from VERSION.txt

  • Python version:

3.11.4

  • Operating system:

Windows 11

What is the current behavior?

Currently it's implemented with an rx operation like this:

// sqrt(NOT) gate
void aer_apply_sx(void *handler, uint_t qubit) {
  AER::AerState *state = reinterpret_cast<AER::AerState *>(handler);
  state->apply_mcrx({qubit}, -M_PI / 4.0);
};

This introduces a different global phase than the sx gate exposed to python (or described in qiskit documentation), for example. It's not a big issue, but I think it should have the same definition.

Steps to reproduce the problem

Compare results obtained with the normal qiskit sx gate and those obtained with using the aer runtime 'aer_apply_sx'.

What is the expected behavior?

Identical results.

Suggested solutions

Replace implementation with:

void aer_apply_sx(void *handler, uint_t qubit) {
  AER::AerState *state = reinterpret_cast<AER::AerState *>(handler);
  state->apply_unitary({ qubit }, AER::Linalg::Matrix::SX);
};

I'll make a pull request for this soon.

@aromanro aromanro added the bug Something isn't working label Sep 4, 2023
doichanj pushed a commit that referenced this issue Sep 6, 2023
* Fix for #1925 (Aer runtime api (from contrib) exposes the wrong sx operation)

* Changed as advised in #1926 (review)
@doichanj doichanj closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants