Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3d0133e
initial attempt
andrijapau Jul 21, 2025
522920f
update pylint version to one with 3.11 support
andrijapau Jul 21, 2025
4c99bd5
try pylint 3.0
andrijapau Jul 21, 2025
c0a10b3
update more github workflow stuff
andrijapau Jul 21, 2025
47ca6be
Merge branch 'master' into drop-python-310-support
andrijapau Jul 21, 2025
2710762
Merge branch 'master' into drop-python-310-support
andrijapau Jul 22, 2025
7510759
upgrade kahypar
andrijapau Jul 22, 2025
9ccaf6b
Merge branch 'master' into drop-python-310-support
albi3ro Jul 23, 2025
4b00427
Update doc/releases/changelog-dev.md
andrijapau Jul 23, 2025
6810353
use latest black pylint and isort
andrijapau Jul 23, 2025
985fa08
Trigger CI
andrijapau Jul 23, 2025
d59b017
fix pylint errors
andrijapau Jul 23, 2025
1208769
fix pylint complaints in codebase
andrijapau Jul 23, 2025
64319d5
fix tests codebase for pylint
andrijapau Jul 23, 2025
313ca24
fix stim
andrijapau Jul 23, 2025
99c2a7b
fix dir
andrijapau Jul 23, 2025
86440d5
fix test_default_qubit_preprocessing
andrijapau Jul 23, 2025
7e57bb7
Merge branch 'master' into drop-python-310-support
andrijapau Jul 23, 2025
28c979e
Update doc/releases/changelog-dev.md
andrijapau Jul 23, 2025
2f2a82b
xfail the qchem tests
andrijapau Jul 24, 2025
b280d8c
Merge branch 'master' into drop-python-310-support
andrijapau Jul 25, 2025
e01b93a
Apply suggestions from code review
andrijapau Jul 25, 2025
0ec3cca
Update tests/qchem/openfermion_pyscf_tests/test_molecular_hamiltonian.py
andrijapau Jul 25, 2025
33a3510
Update tests/qchem/openfermion_pyscf_tests/test_molecular_dipole.py
andrijapau Jul 25, 2025
b363f65
Update tests/optimize/test_qng_qjit.py
andrijapau Jul 25, 2025
9d5e229
Merge branch 'master' into drop-python-310-support
andrijapau Jul 28, 2025
64537ee
Merge branch 'master' into drop-python-310-support
andrijapau Jul 28, 2025
11e5225
Trigger CI
andrijapau Jul 28, 2025
076c5ca
Update .github/workflows/interface-unit-tests.yml
andrijapau Jul 28, 2025
13d4eab
bump torch version
andrijapau Jul 28, 2025
f0eebb1
Merge branch 'drop-python-310-support' of github.com:PennyLaneAI/penn…
andrijapau Jul 28, 2025
306626a
Merge branch 'master' into drop-python-310-support
andrijapau Jul 28, 2025
b91a962
remove recwarn
andrijapau Jul 28, 2025
1fa68f1
pin pylint / isort
andrijapau Jul 28, 2025
283d4d3
fix test_default_qubit.py tests
andrijapau Jul 28, 2025
659a888
Merge branch 'master' into drop-python-310-support
andrijapau Jul 29, 2025
c88430d
update test
andrijapau Jul 29, 2025
7d23c14
fix futurewarning
andrijapau Jul 30, 2025
fda5607
Merge branch 'master' into drop-python-310-support
andrijapau Jul 30, 2025
93dca64
Trigger CI
andrijapau Jul 30, 2025
555d4a3
Merge branch 'master' into drop-python-310-support
andrijapau Jul 30, 2025
f8c955c
bump tensorflow version
andrijapau Jul 31, 2025
6a356a8
Merge branch 'master' into drop-python-310-support
andrijapau Jul 31, 2025
1fc6872
bump requests version
andrijapau Jul 31, 2025
1497ad1
add upgrade to tensorflow install
andrijapau Jul 31, 2025
26d1852
revert github workflows scripts upload reports
andrijapau Jul 31, 2025
e4a29a1
Revert "add upgrade to tensorflow install"
andrijapau Jul 31, 2025
64343dd
add upgrade
andrijapau Jul 31, 2025
94f639c
Try out tf without upgrade
rashidnhm Jul 31, 2025
40d5397
Trigger CI
rashidnhm Jul 31, 2025
1a2a0e5
update requirements-dev.txt
andrijapau Jul 31, 2025
99c00ce
bring back tomli
andrijapau Jul 31, 2025
7ed2874
Revert "bring back tomli"
andrijapau Jul 31, 2025
1546032
don't use toml use tomlkit
andrijapau Jul 31, 2025
6a54050
try load_toml_file fix
andrijapau Jul 31, 2025
e357707
Merge branch 'master' into drop-python-310-support
andrijapau Jul 31, 2025
2962232
Trigger CI
andrijapau Jul 31, 2025
9f7a130
Merge branch 'master' into drop-python-310-support
andrijapau Aug 1, 2025
6db125b
fix pylint
andrijapau Aug 1, 2025
00e7f7a
Trigger CI
andrijapau Aug 1, 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
8 changes: 4 additions & 4 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- name: Install dependencies
run: pip install black pylint==2.7.4 isort==5.13.2
run: pip install black pylint==3.3.7 isort==6.0.1

- uses: actions/checkout@v4

- name: Run Black
run: |
black -t py310 -t py311 -t py312 -l 100 pennylane/ --check
black -t py310 -t py311 -t py312 -l 100 tests/ --check
black -t py311 -t py312 -t py313 -l 100 pennylane/ --check
black -t py311 -t py312 -t py313 -l 100 tests/ --check

- name: Run isort
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/interface-dependency-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
description: The version of TensorFlow to use for testing
required: false
type: string
default: '2.18.0'
default: '2.19.0'
torch_version:
description: The version of PyTorch to use for testing
required: false
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/interface-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ on:
Indicate if a lightened version of the CI should be run instead of the entire suite.

The lightened version of the CI includes the following changes:
- Only Python 3.10 is tested against, instead of 3.10, 3.11, 3.12
- Only Python 3.11 is tested against, instead of 3.11, 3.12, 3.13
required: false
type: boolean
default: false
Expand Down Expand Up @@ -140,31 +140,31 @@ jobs:
then
cat >python_versions.json <<-EOF
{
"default": ["3.10"]
"default": ["3.11"]
}
EOF
elif [ "${{ inputs.python_warning_level }}" == "error" ];
then
cat >python_versions.json <<-EOF
{
"default": ["3.10"]
"default": ["3.11"]
}
EOF
else
cat >python_versions.json <<-EOF
{
"default": ["3.10", "3.11", "3.12"],
"torch-tests": ["3.10", "3.12"],
"tf-tests": ["3.10", "3.12"],
"jax-tests": ["3.10", "3.12"],
"capture-jax-tests": ["3.10", "3.12"],
"all-interfaces-tests": ["3.10"],
"external-libraries-tests": ["3.10"],
"qcut-tests": ["3.10"],
"qchem-tests": ["3.10"],
"gradients-tests": ["3.10"],
"data-tests": ["3.10", "3.12"],
"device-tests": ["3.10"]
"default": ["3.11", "3.12", "3.13"],
"torch-tests": ["3.11", "3.13"],
"tf-tests": ["3.11", "3.12"],
"jax-tests": ["3.11", "3.13"],
"capture-jax-tests": ["3.11", "3.13"],
"all-interfaces-tests": ["3.11"],
"external-libraries-tests": ["3.11"],
"qcut-tests": ["3.11"],
"qchem-tests": ["3.11"],
"gradients-tests": ["3.11"],
"data-tests": ["3.11", "3.13"],
"device-tests": ["3.11"]
}
EOF
fi
Expand Down Expand Up @@ -575,7 +575,7 @@ jobs:
pytest_additional_args: ${{ needs.warnings-as-errors-setup.outputs.pytest_warning_args }}
pytest_xml_file_path: '${{ inputs.job_name_prefix }}qcut-tests (${{ matrix.python-version }})${{ inputs.job_name_suffix }}.xml'
additional_pip_packages: |
kahypar==1.1.7
kahypar==1.3.5
opt_einsum
${{ needs.default-dependency-versions.outputs.jax-version }}
${{ needs.default-dependency-versions.outputs.tensorflow-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/module-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/setup-python@v5

with:
python-version: "3.10"
python-version: "3.11"

- name: Install dependencies
run: pip install tach==0.28.5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rtd-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
rtd_check:
runs-on: ubuntu-24.04
env:
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.11"
# Space separated list of packages to install for each package manager
PIP_PACKAGES_TO_INSTALL: "sphinx"
APT_PACKAGES_TO_INSTALL: "graphviz"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
cancel-in-progress: true

env:
TORCH_VERSION: 2.3.0
TORCH_VERSION: 2.5.1

jobs:
gpu-tests:
Expand All @@ -40,9 +40,9 @@ jobs:
max-parallel: 2
matrix:
python-version:
- '3.10'
- '3.11'
- '3.12'
- '3.13'

env:
SUITE: gpu
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-labs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
additional_os_packages: libopenmpi-dev
pytest_additional_args: --import-mode=importlib
pytest_coverage_flags: --cov-config=pennylane/labs/.coveragerc --cov=pennylane/labs --cov-append --cov-report=term-missing --cov-report=xml --no-flaky-report --tb=native
python_version: '3.10'
python_version: '3.11'
pytest_test_directory: pennylane/labs/tests
additional_pip_packages: |
geometric h5py basis_set_exchange pyscf galois
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ on:
description: The version of Python to use in order to run unit tests
required: false
type: string
default: '3.10'
default: '3.11'
pytest_test_directory:
description: The directory where the PennyLane tests are that should be run by PyTest
required: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"

- name: Build PennyLane wheel
run: |
Expand Down
11 changes: 10 additions & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@ ignored-classes=jax,numpy,scipy,autograd,toml,appdir,autograd.numpy,autograd.num
# it should appear only once).
# Cyclical import checks are disabled for now as they are frequently used in
# the code base, but this can be removed in the future once cycles are resolved.
disable=line-too-long,invalid-name,too-many-lines,redefined-builtin,too-many-locals,duplicate-code,cyclic-import,import-error,bad-option-value
disable=line-too-long,
invalid-name,
too-many-lines,
redefined-builtin,
too-many-locals,
duplicate-code,
cyclic-import,
import-error,
bad-option-value,
too-many-positional-arguments

[MISCELLANEOUS]

Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-24.04
tools:
python: "3.10"
python: "3.11"
apt_packages:
- graphviz

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ For more details and additional features, please see the [PennyLane website](htt

## Installation

PennyLane requires Python version 3.10 and above. Installation of PennyLane, as well as all
PennyLane requires Python version 3.11 and above. Installation of PennyLane, as well as all
dependencies, can be done using pip:

```console
Expand Down
3 changes: 3 additions & 0 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@

<h3>Breaking changes 💔</h3>

* Remove support for Python 3.10 and adds support for 3.13.
[(#7935)](https://github.com/PennyLaneAI/pennylane/pull/7935)

* Move custom exceptions into `exceptions.py` and add a documentation page for them in the internals.
[(#7856)](https://github.com/PennyLaneAI/pennylane/pull/7856)

Expand Down
4 changes: 2 additions & 2 deletions pennylane/capture/dynamic_shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ def _tracer_and_outvar(
Returned vars are cached in env for use in future shapes
"""
if not hasattr(outvar.aval, "shape"):
out_tracer = pe.DynamicJaxprTracer(jaxpr_trace, outvar.aval)
out_tracer = pe.DynamicJaxprTracer(jaxpr_trace, outvar.aval, None)
return out_tracer, jaxpr_trace.makevar(out_tracer)
new_shape = [s if isinstance(s, int) else env[s] for s in outvar.aval.shape]
new_aval = jax.core.DShapedArray(tuple(new_shape), outvar.aval.dtype)
out_tracer = pe.DynamicJaxprTracer(jaxpr_trace, new_aval)
out_tracer = pe.DynamicJaxprTracer(jaxpr_trace, new_aval, None)
new_var = jaxpr_trace.makevar(out_tracer)

if not isinstance(outvar, jax.extend.core.Literal):
Expand Down
4 changes: 3 additions & 1 deletion pennylane/decomposition/symbolic_decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ def _resource_fn(
gate_counts[resource_rep(qml.PauliX)] = num_zero_control_values * 2
return gate_counts

# pylint: disable=too-many-arguments
@register_condition(_condition_fn)
@register_resources(_resource_fn)
def _impl(*params, wires, control_wires, control_values, work_wires, work_wire_type, base, **_):
Expand Down Expand Up @@ -288,6 +289,7 @@ def _flip_control_adjoint_resource(
return {adjoint_resource_rep(inner_rep.op_type, inner_rep.params): 1}


# pylint: disable=too-many-arguments
@register_resources(_flip_control_adjoint_resource)
def flip_control_adjoint(
*_, wires, control_wires, control_values, work_wires, work_wire_type, base, **__
Expand Down Expand Up @@ -327,7 +329,7 @@ def _controlled_decomp_with_work_wire_resource(
}


# pylint: disable=protected-access,unused-argument
# pylint: disable=protected-access,unused-argument, too-many-arguments
@register_condition(_controlled_decomp_with_work_wire_condition)
@register_resources(_controlled_decomp_with_work_wire_resource)
def _controlled_decomp_with_work_wire(
Expand Down
5 changes: 5 additions & 0 deletions pennylane/devices/default_clifford.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ def simulate(
circuit = circuit.map_to_standard_wires()

# Build a stim circuit, tableau and simulator
# pylint: disable=no-member
stim_circuit = stim.Circuit()
tableau_simulator = stim.TableauSimulator()
if self.wires is not None:
Expand Down Expand Up @@ -640,6 +641,7 @@ def _apply_snapshot(
)

# Build a temporary simulator for obtaining state
# pylint: disable=no-member
snap_sim = stim.TableauSimulator()
if self.wires is not None:
snap_sim.set_num_qubits(len(self.wires))
Expand Down Expand Up @@ -790,6 +792,7 @@ def _measure_expectation(self, meas, tableau_simulator, **kwargs):
pauli_term = ["I"] * max(np.max(list(wire)) + 1, tableau_simulator.num_qubits)
for op, wr in zip(pauli, wire):
pauli_term[wr] = op
# pylint:disable=no-member
stim_pauli = stim.PauliString("".join(pauli_term))
expecs[idx] = tableau_simulator.peek_observable_expectation(stim_pauli)

Expand Down Expand Up @@ -955,6 +958,7 @@ def _measure_probability(self, meas, _, **kwargs):
diagonalizing_cit.append_from_stim_program_text(f"{stim_op[0]} {stim_op[1]}")

# Build the Tableau simulator from the diagonalized circuit
# pylint: disable=no-member
circuit_simulator = stim.TableauSimulator()
circuit_simulator.do_circuit(diagonalizing_cit)
if not self._tableau:
Expand Down Expand Up @@ -1042,6 +1046,7 @@ def _sample_variance(self, meas, stim_circuit, shots, seed):
@staticmethod
def _measure_single_sample(stim_ct, meas_ops, meas_idx, meas_wire):
"""Sample a single qubit Pauli measurement from a stim circuit"""
# pylint: disable=no-member
stim_sm = stim.TableauSimulator()
stim_sm.do_circuit(stim_ct)
res = [0] * meas_idx + meas_ops + [0] * (meas_wire - meas_idx - 1)
Expand Down
4 changes: 4 additions & 0 deletions pennylane/drawer/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def catalyst_qjit(qnode):
return qnode.__class__.__name__ == "QJIT" and hasattr(qnode, "user_function")


# pylint: disable=too-many-arguments
def draw(
qnode,
wire_order=None,
Expand Down Expand Up @@ -333,6 +334,7 @@ def wrapper(*args, **kwargs):
return wrapper


# pylint: disable=too-many-arguments
def _draw_qnode(
qnode,
wire_order: Sequence | None = None,
Expand Down Expand Up @@ -386,6 +388,7 @@ def wrapper(*args, **kwargs):
return wrapper


# pylint: disable=too-many-arguments
def draw_mpl(
qnode: QNode | Callable,
wire_order: Sequence | None = None,
Expand Down Expand Up @@ -824,6 +827,7 @@ def wrapper(*args, **kwargs):
return wrapper


# pylint: disable=too-many-arguments
def _draw_mpl_qnode(
qnode,
wire_order=None,
Expand Down
4 changes: 2 additions & 2 deletions pennylane/io/qualtran_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ def _(op: qtemps.subroutines.ModExp):

gate_types = defaultdict(int, {})
ctrl_spec = CtrlSpec(cvs=[1])
for comp_rep in mult_resources:
for comp_rep, value in mult_resources.items():
new_rep = comp_rep.controlled(ctrl_spec)
if comp_rep == qt_gates.CNOT():
new_rep = qt_gates.Toffoli()
Expand All @@ -428,7 +428,7 @@ def _(op: qtemps.subroutines.ModExp):
if comp_rep.subbloq.op.name == "QFT":
gate_types[new_rep] = 1
else:
gate_types[new_rep] = mult_resources[comp_rep] * ((2**num_x_wires) - 1)
gate_types[new_rep] = value * ((2**num_x_wires) - 1)

return gate_types

Expand Down
2 changes: 1 addition & 1 deletion pennylane/labs/zxopt/full_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def full_optimize(
"""
if not has_zx: # pragma: no cover
raise ImportError(
"full_optimize requires the package pyzx. " "You can install it with pip install pyzx"
"full_optimize requires the package pyzx. You can install it with pip install pyzx"
) # pragma: no cover

try:
Expand Down
2 changes: 1 addition & 1 deletion pennylane/labs/zxopt/full_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def full_reduce(tape: QuantumScript) -> tuple[QuantumScriptBatch, Postprocessing
"""
if not has_zx: # pragma: no cover
raise ImportError(
"full_reduce requires the package pyzx. " "You can install it with pip install pyzx"
"full_reduce requires the package pyzx. You can install it with pip install pyzx"
) # pragma: no cover

pyzx_circ = _tape2pyzx(tape)
Expand Down
2 changes: 1 addition & 1 deletion pennylane/labs/zxopt/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _tape2pyzx(tape):
"""
if not has_zx: # pragma: no cover
raise ImportError(
"_tape2pyzx requires the package pyzx. " "You can install it with pip install pyzx"
"_tape2pyzx requires the package pyzx. You can install it with pip install pyzx"
) # pragma: no cover

g = Circuit.from_qasm(_remove_measurement_patterns(tape.to_openqasm()))
Expand Down
2 changes: 1 addition & 1 deletion pennylane/ops/op_math/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def resource_params(self):
return {"resources": resources}

_op_symbol = "@"
_math_op = math.prod
_math_op = staticmethod(math.prod)
grad_method = None

@property
Expand Down
2 changes: 1 addition & 1 deletion pennylane/ops/op_math/sum.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def circuit(weights):
"""

_op_symbol = "+"
_math_op = math.sum
_math_op = staticmethod(math.sum)
grad_method = "A"

def _flatten(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _add_catalyst_skip_op_types():

_CATALYST_SKIP_OP_TYPES = (*_CATALYST_SKIP_OP_TYPES, MidCircuitMeasure)
except (ModuleNotFoundError, ImportError): # pragma: no cover
return
pass


def _check_clifford_op(op, use_decomposition=False):
Expand Down
Loading