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

spex backend #379

Merged
merged 33 commits into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b730ed9
adding spex as a supported backend
Mikel-Ma Dec 12, 2024
a2e3b72
simulator_spex.py
Mikel-Ma Dec 12, 2024
f987cb9
simple test case
Mikel-Ma Dec 12, 2024
ded9d31
compiler_arguments fix
Mikel-Ma Dec 12, 2024
6f359e1
using make_generator for QGateImpl
Mikel-Ma Dec 18, 2024
03a4525
switch from paulistrings to paulimaps
Mikel-Ma Jan 3, 2025
3b1ff99
using ExpPauliTerm in circuit
Mikel-Ma Jan 3, 2025
816c0f3
cashing using a circuit hash
Mikel-Ma Jan 3, 2025
c310e0f
using SPEX and OMP_NUM_THREADS for parallelisation if available
Mikel-Ma Jan 19, 2025
c712cd8
using a threshold to eliminate elements with negligible amplitudes
Mikel-Ma Jan 20, 2025
04108b7
disabling thresholds by setting them None
Mikel-Ma Jan 23, 2025
1dd3b61
removing print
Mikel-Ma Jan 30, 2025
4f88e4e
compress_qubit_indicies and moving thresholding to c++
Mikel-Ma Feb 1, 2025
c8cd8fb
deleting test_spex_simulator
Mikel-Ma Feb 1, 2025
241f7b4
Update ci_backends.yml
kottmanj Feb 1, 2025
1e5e21c
adding missing " in ci_backends.yml
Mikel-Ma Feb 4, 2025
3cf0a4b
print in simulator_spex.py removed
Mikel-Ma Feb 4, 2025
bae3adf
assign_parameter
Mikel-Ma Feb 6, 2025
e021826
fix for test_initial_state_from_integer and test_wfn_simple_consistency
Mikel-Ma Feb 6, 2025
0b5a14d
num_qubits param for spex backend (from LSB to MSB)
Mikel-Ma Feb 7, 2025
8c182b0
Update ci_backends.yml
kottmanj Feb 11, 2025
a47a246
Update ci_backends.yml
kottmanj Feb 11, 2025
e6d0428
manual compiling
kottmanj Feb 11, 2025
6311136
Update ci_backends.yml
kottmanj Feb 11, 2025
a482853
Update ci_backends.yml
kottmanj Feb 11, 2025
068eca2
Update ci_backends.yml
kottmanj Feb 11, 2025
88cff1f
Update ci_backends.yml
kottmanj Feb 11, 2025
1e87864
adding variables to hash
Mikel-Ma Feb 25, 2025
bf352ab
disabled compressing and added prints
Mikel-Ma Feb 26, 2025
e7ad7d8
fix qubit mapping by overriding simulate in BackendCircuitSpex to avo…
Mikel-Ma Mar 4, 2025
a37247c
cleanup
Mikel-Ma Mar 4, 2025
e3e5142
QubitExcitationImpl
Mikel-Ma Mar 4, 2025
a8f7bdd
Merge branch 'devel' into devel
kottmanj Mar 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/ci_backends.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,27 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9']

python-version: ['3.10']
include:
- os: ubuntu-latest
cxx: /usr/bin/g++-14
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install spex
run: |
python -m pip install --upgrade pip
pip install git+https://github.com/Mikel-Ma/spex@devel
- name: Install basic dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
if [ $ver -eq 7 ]; then
# myqlm does not work in python3.7
pip install "cirq" "qiskit>=0.30" "qulacs" "qibo==0.1.1"
elif [ $ver -eq 8 ]; then
pip install "cirq" "qiskit" "qulacs" "qibo==0.1.1" "myqlm" "cirq-google"
fi
pip install -e .
pip install "qiskit" "qulacs"
# pip install cirq # installs too much stuff currently
pip install -e .
- name: Lint with flake8
run: |
pip install flake8
Expand Down
11 changes: 10 additions & 1 deletion src/tequila/simulators/simulator_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from tequila.circuit.noise import NoiseModel
from tequila.wavefunction.qubit_wavefunction import QubitWaveFunction

SUPPORTED_BACKENDS = ["qulacs", "qulacs_gpu", "qibo", "qiskit", "qiskit_gpu", "cirq", "pyquil", "symbolic", "qlm"]
SUPPORTED_BACKENDS = ["qulacs", "qulacs_gpu", "qibo", "qiskit", "qiskit_gpu", "cirq", "pyquil", "symbolic", "qlm", "spex"]
SUPPORTED_NOISE_BACKENDS = ["qiskit", "qiskit_gpu", "cirq", "pyquil"] # qulacs removed in v.1.9
BackendTypes = namedtuple('BackendTypes', 'CircType ExpValueType')
INSTALLED_SIMULATORS = {}
Expand All @@ -30,6 +30,15 @@
"""


HAS_SPEX = True
try:
from tequila.simulators.simulator_spex import BackendCircuitSpex, BackendExpectationValueSpex

INSTALLED_SIMULATORS["spex"] = BackendTypes(BackendCircuitSpex, BackendExpectationValueSpex)
except ImportError:
HAS_SPEX = False


HAS_QISKIT = True
try:
from tequila.simulators.simulator_qiskit import BackendCircuitQiskit, BackendExpectationValueQiskit
Expand Down
Loading