question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose Numpy simulator as Backend

See original GitHub issue

What is the expected enhancement?

Qiskit includes a statevector simulator that uses Numpy. This is very nice because it means users can simulate circuits without installing Aer. However, I think the interface could be improved.

Currently the simulator is called using the Statevector class:

from qiskit.quantum_info import Statevector
state = Statevector(circuit)

It would be useful to expand this functionality so it is used in the same way as other backends. That way it can be incorporated into code workflows that use backends.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
kevinsungcommented, Feb 8, 2022

@Cryoris explained to me offline that the BasicAer backend exists and is exactly what I am asking for. So I’ll close this issue, though I will say that the existence of BasicAer should probably be mentioned more prominently in the documentation.

0reactions
jakelishmancommented, Mar 3, 2022

Sorry about the delay re-opening, these issues had fallen off the front page of my notifications between them updating and me looking at my queue.

I’ve re-opened #7634, but left #7633 closed on the basis that “use quantum_info” is a duplicate of #7670, and the “support all matrices” is something that we can’t officially fulfill within the Backend spec - if BasicAer is converted to use quantum_info underneath, then BasicAer.run() will support all instructions with a matrix, but we can’t make BasicAer appear that way to things consuming the Backend API (more detail in #7633).

I’ll close this on the basis that #7670 is the direction we want to take to solve the underlying issue here, rather than making a new backend. If I’ve missed a further point in one of these issues, please let me know.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Simulating COVID-19 using Python, NumPy & Matplotlib [in ...
In this in-depth Python tutorial using NumPy and Matplotlib, Caelan walks you through how to simulate the spread of a virus, using covid-19 ......
Read more >
Simulation in NumPy — PsychRNN 1.0.0 documentation
Here we will demonstrate training a simple model in tensorflow, and then loading it and simulating it in NumPy. The Simulator can be...
Read more >
Array programming with NumPy - Nature
NumPy is the primary array programming library for the Python language. It has an essential role in research analysis pipelines in fields as ......
Read more >
NumPy User Guide
It is a Python library that provides a multidi- mensional array object, various derived objects (such as masked arrays and matrices), and an ......
Read more >
Separating NumPy API from Implementation - DLR
In this paper, we introduce a unified NumPy backend that ... exposes NumPy applications as a stream of abstract array ... The simulation...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found