Skip to content

Commit

Permalink
Merge 6f3c857 into 389b8b8
Browse files Browse the repository at this point in the history
  • Loading branch information
garrison committed Apr 11, 2023
2 parents 389b8b8 + 6f3c857 commit 3044228
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 8 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/test_latest_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
max-parallel: 4
matrix:
os: [ubuntu-latest]
python-version: ["3.7", "3.10"]
python-version: ["3.7", "3.11"]
include:
- os: macos-latest
python-version: "3.7"
Expand All @@ -43,4 +43,10 @@ jobs:
shell: bash
run: |
pver=${{ matrix.python-version }}
tox -epy${pver/./},py${pver/./}-notebook
tox -epy${pver/./}
if [ "$pver" = "3.11" ]; then
echo Skipping tutorials that require cplex
tox -epy${pver/./}-notebook -- --ignore=docs/tutorials/circuit_cutting/tutorial_1_automatic_cut_finding.ipynb --ignore=docs/tutorials/circuit_cutting/tutorial_3_cutting_with_quantum_serverless.ipynb
else
tox -epy${pver/./}-notebook
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

[![Stability](https://img.shields.io/badge/Stability-alpha-f4d03f.svg)](https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/releases)
![Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS-informational)
[![Python](https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-informational)](https://www.python.org/)
[![Python](https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-informational)](https://www.python.org/)
[![Qiskit](https://img.shields.io/badge/Qiskit-%E2%89%A5%200.39.0-6133BD)](https://github.com/Qiskit/qiskit)
[![Qiskit Nature](https://img.shields.io/badge/Qiskit%20Nature-%E2%89%A5%200.4.4-6133BD)](https://github.com/Qiskit/qiskit-nature)
<br />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from .wire_cutting_evaluation import run_subcircuit_instances
from .wire_cutting_post_processing import generate_summation_terms, build
from .wire_cutting_verification import generate_reconstructed_output
from .mip_model import MIPModel


def cut_circuit_wires(
Expand Down Expand Up @@ -364,6 +363,8 @@ def find_wire_cuts(
max_cuts=max_cuts,
)

from .mip_model import MIPModel

mip_model = MIPModel(**kwargs)
feasible = mip_model.solve(min_postprocessing_cost=min_cost)
if not feasible:
Expand Down
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering :: Physics",
]

Expand All @@ -30,11 +31,15 @@ dependencies = [
"qiskit-terra>=0.22.0",
"qiskit-nature>=0.4.4",
"qiskit-ibm-runtime>=0.7.0",
"docplex>=2.23.222",
"cplex>=22.1.0.0; platform_machine != 'arm64'",
]

[project.optional-dependencies]
cplex = [
# We use the same restrictions in both of the following lines, as there
# is no reason for us to install docplex without cplex.
"docplex>=2.23.222; python_version < '3.11' and platform_machine != 'arm64'",
"cplex>=22.1.0.0; python_version < '3.11' and platform_machine != 'arm64'",
]
dev = [
"circuit-knitting-toolbox[test,lint]",
"nbmake",
Expand Down Expand Up @@ -65,6 +70,7 @@ docs = [
"reno>=3.4.0",
]
notebook-dependencies = [
"circuit-knitting-toolbox[cplex]",
"quantum-serverless>=0.0.1",
"pyscf>=2.0.1; sys_platform != 'win32'",
"matplotlib",
Expand Down
4 changes: 4 additions & 0 deletions test/circuit_cutting/test_circuit_cutting.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"""Tests for circuit_cutting package."""

import unittest
import importlib

import numpy as np
from qiskit import QuantumCircuit
Expand All @@ -23,6 +24,8 @@
verify,
)

cplex_available = importlib.find_loader("cplex") is not None


class TestCircuitCutting(unittest.TestCase):
def setUp(self):
Expand All @@ -46,6 +49,7 @@ def setUp(self):

self.circuit = qc

@unittest.skipIf(not cplex_available, "cplex is not installed")
def test_circuit_cutting_automatic(self):
qc = self.circuit
cuts = cut_circuit_wires(
Expand Down
6 changes: 4 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[tox]
minversion = 3.25
envlist = py{37,38,39,310}{,-notebook}, lint, coverage, docs
envlist = py{37,38,39,310,311}{,-notebook}, lint, coverage, docs
isolated_build = True

[testenv]
extras =
test
cplex
commands =
pytest test/ {posargs}

Expand All @@ -27,7 +28,7 @@ commands =
mypy circuit_knitting_toolbox/
reno lint

[testenv:{py37-,py38-,py39-,py310-,}notebook]
[testenv:{,py37-,py38-,py39-,py310-,py311-}notebook]
deps =
nbmake
extras =
Expand All @@ -40,6 +41,7 @@ deps =
coverage>=5.5
extras =
test
cplex
commands =
coverage3 run --source circuit_knitting_toolbox --parallel-mode -m pytest test/ {posargs}
coverage3 combine
Expand Down

0 comments on commit 3044228

Please sign in to comment.