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

Use BackendV2 for basic aer #10690

Closed
mtreinish opened this issue Aug 22, 2023 · 2 comments · Fixed by #11422
Closed

Use BackendV2 for basic aer #10690

mtreinish opened this issue Aug 22, 2023 · 2 comments · Fixed by #11422
Assignees
Labels
type: feature request New feature or request
Milestone

Comments

@mtreinish
Copy link
Member

What should we add?

Right now the backends in qiskit.providers.basicaer are all built on the legacy BackendV1 model. We should update it to be based on the more modern BackendV2 instead. The target will be very simple for these backends, it's basically just:

MAX_QUBITS_MEMORY = int(log2(local_hardware_info()["memory"] * (1024**3) / 16))
target = Target(num_qubits=min(24, MAX_QUBITS_MEMORY)
lam = Parameter("lambda")
target.add_instruction(U1Gate(lam))
phi = Parameter("phi")
target.add_instruction(U2Gate(phi, lam))
theta = Parameter("theta")
target.add_instruction(U3Gate(theta, phi, lam))
target.add_instruction(RZGate(phi))
target.add_instruction(SXGate())
target.add_instruction(XGate())
target.add_instruction(CXGate())
target.add_instruction(IGate())
target.add_instruction(UnitaryGate, name="unitary")

The trickier piece here is more about maintaining backwards compatibility for all the pieces that are part of the BackendV1 interface and not in the BackendV2 interface to give users a chance to migrate.

@mtreinish mtreinish added the type: feature request New feature or request label Aug 22, 2023
@burgholzer
Copy link
Contributor

Might I point out #10592 in that regard as it also popped up during an attempt to move our classical simulation backends from BackendV1 to BackendV2?

@mtreinish mtreinish added this to the 0.46.0 milestone Aug 22, 2023
@MozammilQ
Copy link
Contributor

@mtreinish , am I allowed to try this one?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants