Skip to content

Commit

Permalink
use qiskit-aer in github testing env
Browse files Browse the repository at this point in the history
  • Loading branch information
dakk committed Oct 30, 2023
1 parent 302c4eb commit c11441f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@
import random
from typing import Tuple, get_args

from pyqrack import qrack_simulator
from qiskit import QuantumCircuit, transpile
from qiskit.providers.qrack import Qrack
from qiskit_aer import Aer
from sympy.logic.boolalg import gateinputcount

from qlasskit import Qint, QlassF, Qtype, compiler, const_to_qtype

COMPILATION_ENABLED = True

try:
from pyqrack import qrack_simulator
from qiskit.providers.qrack import Qrack

qsk_simulator = Qrack.get_backend("qasm_simulator")
except:
qsk_simulator = Aer.get_backend("aer_simulator")


def test_not(a: bool) -> bool:
return not a
Expand All @@ -39,14 +45,10 @@ def test_qint3(a: Qint3) -> bool:
return not a[0]


aer_simulator = Aer.get_backend("aer_simulator")
# aer_simulator = Qrack.get_backend("qasm_simulator")


def qiskit_measure_and_count(circ, shots=1):
circ.measure_all()
circ = transpile(circ, aer_simulator)
result = aer_simulator.run(circ, shots=shots).result()
circ = transpile(circ, qsk_simulator)
result = qsk_simulator.run(circ, shots=shots).result()
counts = result.get_counts(circ)
return counts

Expand Down

0 comments on commit c11441f

Please sign in to comment.