Skip to content

Commit

Permalink
PCVL-749 Remove python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit-F-Q committed Sep 5, 2024
1 parent 4d6536d commit a12c10f
Show file tree
Hide file tree
Showing 55 changed files with 9 additions and 84 deletions.
1 change: 0 additions & 1 deletion .github/workflows/autotests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ on:
default: '3.10'
type: choice
options:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ practitioners.

Perceval requires:

* Above Python 3.8 and below Python 3.12
* Above Python 3.9 and below Python 3.12

## PIP
We recommend installing it with `pip`:
Expand Down
1 change: 0 additions & 1 deletion docs/source/notebooks/Reinforcement_learning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
"metadata": {},
"outputs": [],
"source": [
"from typing import Union\n",
"import math\n",
"\n",
"from ipywidgets import FloatProgress\n",
Expand Down
1 change: 0 additions & 1 deletion perceval/algorithm/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from typing import Callable, List, Dict
from numbers import Number

from .abstract_algorithm import AAlgorithm
Expand Down
1 change: 0 additions & 1 deletion perceval/backends/_naive_approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.

import math
from typing import List, Tuple

import exqalibur as xq
from . import NaiveBackend
Expand Down
1 change: 0 additions & 1 deletion perceval/backends/_slos.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import exqalibur as xq
import math
import numpy as np
from typing import Dict, List


class _Path:
Expand Down
2 changes: 0 additions & 2 deletions perceval/components/_mode_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from typing import Dict, List, Union

from perceval.utils.logging import logger, channel

from .abstract_component import AComponent
Expand Down
1 change: 0 additions & 1 deletion perceval/components/abstract_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.

from abc import ABC
from typing import Dict, Union, List, Iterable
import sympy as sp
import copy

Expand Down
1 change: 0 additions & 1 deletion perceval/components/abstract_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from abc import ABC, abstractmethod
from enum import Enum
from multipledispatch import dispatch
from typing import Any, Dict, List, Union, Tuple

from perceval.components.linear_circuit import Circuit, ACircuit
from perceval.utils import BasicState, Parameter, PostSelect, postselect_independent, LogicalState, NoiseModel
Expand Down
1 change: 0 additions & 1 deletion perceval/components/component_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import importlib
from abc import ABC, abstractmethod
from enum import Enum
from typing import List

from perceval.utils import Parameter
from perceval.components import Processor, Circuit
Expand Down
1 change: 0 additions & 1 deletion perceval/components/generic_interferometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.

import math
from typing import Callable, List, Optional, Tuple

from .linear_circuit import ACircuit, Circuit

Expand Down
1 change: 0 additions & 1 deletion perceval/components/linear_circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import random

from abc import ABC, abstractmethod
from typing import Callable, Optional, Union, Tuple, Type, List

import numpy as np
import sympy as sp
Expand Down
1 change: 0 additions & 1 deletion perceval/components/port.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.

from abc import ABC, abstractmethod
from typing import List, Union
from enum import Enum

from perceval.utils import BasicState, Encoding, LogicalState
Expand Down
1 change: 0 additions & 1 deletion perceval/components/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

from multipledispatch import dispatch
from numpy import inf
from typing import Dict, Callable, Union, List

from perceval.backends import ABackend, ASamplingBackend, BACKEND_LIST
from perceval.utils import SVDistribution, BSDistribution, BasicState, StateVector, LogicalState, NoiseModel
Expand Down
1 change: 0 additions & 1 deletion perceval/components/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

from perceval.utils import SVDistribution, StateVector, BasicState, anonymize_annotations, NoiseModel, global_params
from perceval.utils.logging import logger, channel
from typing import Dict, List, Union


class Source:
Expand Down
1 change: 0 additions & 1 deletion perceval/components/tomography_exp_configurer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import List
from .processor import AProcessor
from ._pauli import PauliType, PauliEigenStateType, get_pauli_eigen_state_prep_circ, get_pauli_basis_measurement_circuit

Expand Down
1 change: 0 additions & 1 deletion perceval/error_mitigation/loss_mitigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import numpy as np
from math import comb
from scipy.optimize import curve_fit
from typing import Union
from perceval.utils import BSCount, BSDistribution, BasicState
from perceval.utils.logging import logger, channel
from ._loss_mitigation_utils import _gen_lossy_dists, _get_avg_exp_from_uni_dist, _generate_one_photon_per_mode_mapping
Expand Down
1 change: 0 additions & 1 deletion perceval/providers/scaleway/scaleway_rpc_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

from datetime import datetime, timedelta
from requests import HTTPError
from typing import Union
from enum import Enum

_PROVIDER_NAME = "quandela"
Expand Down
1 change: 0 additions & 1 deletion perceval/rendering/canvas/canvas.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

from __future__ import annotations
from abc import ABC
from typing import List, Union, Tuple


class Canvas(ABC):
Expand Down
2 changes: 0 additions & 2 deletions perceval/rendering/circuit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import Type

from .abstract_skin import ASkin, ModeStyle
from .phys_skin import PhysSkin
from .symb_skin import SymbSkin
Expand Down
1 change: 0 additions & 1 deletion perceval/rendering/circuit/abstract_skin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

from abc import ABC, abstractmethod
from enum import Enum
from typing import Callable, Tuple
from multipledispatch import dispatch

from perceval.components import ACircuit, AProcessor, PERM
Expand Down
1 change: 0 additions & 1 deletion perceval/rendering/circuit/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from abc import ABC, abstractmethod
import copy
import math
from typing import Any, Tuple

from perceval.rendering.circuit import ASkin, ModeStyle
from perceval.rendering.format import Format
Expand Down
3 changes: 2 additions & 1 deletion perceval/rendering/pdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
import networkx as nx
import sympy as sp
from tabulate import tabulate
from typing import Union
import matplotlib.pyplot as plt
import sympy as sp

from perceval.algorithm import Analyzer, AProcessTomography
from perceval.components import ACircuit, Circuit, AProcessor, non_unitary_components as nl
Expand Down
1 change: 0 additions & 1 deletion perceval/runtime/_token_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.

import os
from typing import Union

from perceval.utils.logging import logger, channel

Expand Down
1 change: 0 additions & 1 deletion perceval/runtime/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.

from abc import ABC, abstractmethod
from typing import Dict, Callable

from perceval.utils.logging import logger, channel

Expand Down
1 change: 0 additions & 1 deletion perceval/runtime/job_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

from enum import Enum
from time import time, sleep
from typing import Optional

from perceval.utils.logging import logger, channel

Expand Down
1 change: 0 additions & 1 deletion perceval/runtime/local_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import Callable, Optional
import threading

from perceval.utils.logging import logger, channel
Expand Down
1 change: 0 additions & 1 deletion perceval/runtime/remote_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import json
import time
from typing import Any
from requests.exceptions import HTTPError, ConnectionError

from .job import Job
Expand Down
1 change: 0 additions & 1 deletion perceval/runtime/remote_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import uuid
from typing import Dict, List, Any
from multipledispatch import dispatch

from perceval.components.abstract_processor import AProcessor, ProcessorType
Expand Down
2 changes: 0 additions & 2 deletions perceval/serialization/_parameter_serialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from typing import Union

from perceval.utils import Parameter, Expression
from perceval.serialization import _schema_circuit_pb2 as pb

Expand Down
1 change: 0 additions & 1 deletion perceval/serialization/deserialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.
from base64 import b64decode
from os import path
from typing import Union
import json
from zlib import decompress

Expand Down
1 change: 0 additions & 1 deletion perceval/simulators/_simulator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from perceval.components import Circuit
from copy import copy
from math import sqrt
from typing import List


def _to_bsd(sv: StateVector) -> BSDistribution:
Expand Down
1 change: 0 additions & 1 deletion perceval/simulators/delay_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from perceval.utils import BasicState, BSDistribution, StateVector, global_params

from enum import Enum
from typing import List, Tuple


class _CType(Enum):
Expand Down
2 changes: 0 additions & 2 deletions perceval/simulators/loss_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
from perceval.components import ACircuit, LC, PERM, BS
from perceval.utils import BasicState, BSDistribution, StateVector

from typing import List


class LossSimulator(ASimulatorDecorator):

Expand Down
2 changes: 1 addition & 1 deletion perceval/simulators/noisy_sampling_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# SOFTWARE.
import math
import time
from typing import Callable, Dict, Tuple
import sys

from perceval.backends import ASamplingBackend
from perceval.components import ACircuit
Expand Down
2 changes: 0 additions & 2 deletions perceval/simulators/simulator_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
from perceval.components import ACircuit, TD, LC, Processor
from perceval.backends import ABackend, SLOSBackend, BACKEND_LIST

from typing import List, Union


class SimulatorFactory:
"""
Expand Down
1 change: 0 additions & 1 deletion perceval/simulators/simulator_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.

from abc import ABC, abstractmethod
from typing import Callable, Dict

from perceval.components import ACircuit
from perceval.utils import BSDistribution, StateVector, SVDistribution, PostSelect, post_select_distribution, \
Expand Down
1 change: 0 additions & 1 deletion perceval/simulators/stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from collections import defaultdict
from typing import List, Union, Callable, Dict
import copy

from perceval.utils import StateVector, BasicState, BSDistribution, SVDistribution, allstate_iterator
Expand Down
2 changes: 0 additions & 2 deletions perceval/utils/algorithms/circuit_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import Callable, Tuple, Union

import exqalibur as xq
from perceval.components import ACircuit, Circuit, GenericInterferometer, BS, PS, catalog
from perceval.utils import Matrix, P
Expand Down
1 change: 0 additions & 1 deletion perceval/utils/algorithms/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import Optional, Callable, List
from perceval.components.linear_circuit import ACircuit
from perceval.utils import Matrix, P, global_params

Expand Down
2 changes: 0 additions & 2 deletions perceval/utils/algorithms/simplification.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from typing import Union

import numpy as np
import perceval.components.unitary_components as comp
from perceval.components.linear_circuit import ACircuit, Circuit
Expand Down
1 change: 0 additions & 1 deletion perceval/utils/density_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import random
from copy import copy
from math import comb, sqrt
from typing import Union, Optional, List, Tuple

import numpy as np
from numpy import conj
Expand Down
6 changes: 1 addition & 5 deletions perceval/utils/density_matrix_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@
# SOFTWARE.

import sys
from typing import Union

import numpy as np
from scipy.sparse import csr_array
if sys.version.startswith('3.8.'):
from scipy.sparse import spmatrix as sparray
else:
from scipy.sparse import sparray
from scipy.sparse import sparray

from perceval.utils.statevector import StateVector

Expand Down
2 changes: 0 additions & 2 deletions perceval/utils/logical_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

from typing import List


class LogicalState(list):
def __init__(self, state: List[int] or str = None):
Expand Down
1 change: 0 additions & 1 deletion perceval/utils/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

from abc import ABC, abstractmethod
from scipy.linalg import sqrtm, block_diag, svd
from typing import Iterator, Optional, Union, Tuple
import numpy as np
import sympy as sp

Expand Down
1 change: 0 additions & 1 deletion perceval/utils/noise_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
# SOFTWARE.

from ._validated_params import AValidatedParam, ValidatedBool, ValidatedFloat
from typing import Dict


class NoiseModel:
Expand Down
1 change: 0 additions & 1 deletion perceval/utils/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import random
import sympy as sp

from typing import Tuple


class Parameter:
Expand Down
Loading

0 comments on commit a12c10f

Please sign in to comment.