diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 003ac5d0dd..62c24171a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: - id: isort args: ["--profile", "black"] - repo: https://github.com/asottile/pyupgrade - rev: v3.15.2 + rev: v3.16.0 hooks: - id: pyupgrade - repo: https://github.com/hadialqattan/pycln diff --git a/doc/source/api-reference/qibo.rst b/doc/source/api-reference/qibo.rst index 9a107c3c92..a07e5d8170 100644 --- a/doc/source/api-reference/qibo.rst +++ b/doc/source/api-reference/qibo.rst @@ -930,6 +930,13 @@ Toffoli :members: :member-order: bysource +CCZ +""" + +.. autoclass:: qibo.gates.CCZ + :members: + :member-order: bysource + Deutsch """"""" diff --git a/doc/source/code-examples/advancedexamples.rst b/doc/source/code-examples/advancedexamples.rst index 64bf31c0fc..de2388dcd3 100644 --- a/doc/source/code-examples/advancedexamples.rst +++ b/doc/source/code-examples/advancedexamples.rst @@ -702,6 +702,9 @@ the following script optimizes the parameters of two rotations so that the circu output matches a target state using the fidelity as the corresponding loss function. +Note that, as in the following example, the rotation angles have to assume real values +to ensure the rotational gates are representing unitary operators. + .. code-block:: python import qibo @@ -716,7 +719,7 @@ function. # Define circuit ansatz params = tf.Variable( - tf.random.uniform((2,), dtype=tf.float64).astype(tf.complex128) + tf.random.uniform((2,), dtype=tf.float64) ) c = models.Circuit(2) c.add(gates.RX(0, params[0])) @@ -729,7 +732,6 @@ function. fidelity = tf.math.abs(tf.reduce_sum(tf.math.conj(target_state) * final_state)) loss = 1 - fidelity grads = tape.gradient(loss, params) - grads = tf.math.real(grads) optimizer.apply_gradients(zip([grads], [params])) @@ -763,7 +765,6 @@ For example: fidelity = tf.math.abs(tf.reduce_sum(tf.math.conj(target_state) * final_state)) loss = 1 - fidelity grads = tape.gradient(loss, params) - grads = tf.math.real(grads) optimizer.apply_gradients(zip([grads], [params])) for _ in range(nepochs): diff --git a/doc/source/code-examples/applications-by-algorithm.rst b/doc/source/code-examples/applications-by-algorithm.rst index 3819ba99b3..1f69431d96 100644 --- a/doc/source/code-examples/applications-by-algorithm.rst +++ b/doc/source/code-examples/applications-by-algorithm.rst @@ -76,4 +76,12 @@ Diagonalization Algorithms .. toctree:: :maxdepth: 1 - tutorials/dbi/dbi.ipynb + tutorials/dbi/README.md + + tutorials/dbi/dbi_cost_functions.ipynb + tutorials/dbi/dbi_gradient_descent_strategies.ipynb + tutorials/dbi/dbi_scheduling.ipynb + tutorials/dbi/dbi_strategies_compare.ipynb + tutorials/dbi/dbi_strategy_Ising_model.ipynb + tutorials/dbi/dbi_strategy_Pauli-Z.ipynb + tutorials/dbi/dbi_tutorial_basic_intro.ipynb diff --git a/doc/source/code-examples/applications-by-topic.rst b/doc/source/code-examples/applications-by-topic.rst index 8d44557d48..500300e9b4 100644 --- a/doc/source/code-examples/applications-by-topic.rst +++ b/doc/source/code-examples/applications-by-topic.rst @@ -61,7 +61,6 @@ Quantum Physics tutorials/bell-variational/README.md tutorials/falqon/README.md tutorials/grover/README.md - tutorials/dbi/dbi.ipynb Quantum Machine Learning ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/source/code-examples/applications.rst b/doc/source/code-examples/applications.rst index 8787659178..9fa6976b54 100644 --- a/doc/source/code-examples/applications.rst +++ b/doc/source/code-examples/applications.rst @@ -69,8 +69,6 @@ Quantum Physics tutorials/bell-variational/README.md tutorials/falqon/README.md tutorials/grover/README.md - tutorials/dbi/dbi.ipynb - Quantum Machine Learning ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/source/code-examples/tutorials/dbi/README.md b/doc/source/code-examples/tutorials/dbi/README.md new file mode 120000 index 0000000000..50b9e9eaec --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/README.md @@ -0,0 +1 @@ +../../../../../examples/dbi/README.md \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi.ipynb b/doc/source/code-examples/tutorials/dbi/dbi.ipynb deleted file mode 120000 index 7deb426d68..0000000000 --- a/doc/source/code-examples/tutorials/dbi/dbi.ipynb +++ /dev/null @@ -1 +0,0 @@ -../../../../../examples/dbi/dbi.ipynb \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi_cost_functions.ipynb b/doc/source/code-examples/tutorials/dbi/dbi_cost_functions.ipynb new file mode 120000 index 0000000000..1c36a4d760 --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/dbi_cost_functions.ipynb @@ -0,0 +1 @@ +../../../../../examples/dbi/dbi_cost_functions.ipynb \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi_gradient_descent_strategies.ipynb b/doc/source/code-examples/tutorials/dbi/dbi_gradient_descent_strategies.ipynb new file mode 120000 index 0000000000..e3fbf989a9 --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/dbi_gradient_descent_strategies.ipynb @@ -0,0 +1 @@ +../../../../../examples/dbi/dbi_gradient_descent_strategies.ipynb \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi_group_commutator_tests.ipynb b/doc/source/code-examples/tutorials/dbi/dbi_group_commutator_tests.ipynb new file mode 120000 index 0000000000..174deb7e46 --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/dbi_group_commutator_tests.ipynb @@ -0,0 +1 @@ +../../../../../examples/dbi/dbi_group_commutator_tests.ipynb \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi_scheduling.ipynb b/doc/source/code-examples/tutorials/dbi/dbi_scheduling.ipynb new file mode 120000 index 0000000000..79275e8268 --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/dbi_scheduling.ipynb @@ -0,0 +1 @@ +../../../../../examples/dbi/dbi_scheduling.ipynb \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi_strategies_compare.ipynb b/doc/source/code-examples/tutorials/dbi/dbi_strategies_compare.ipynb new file mode 120000 index 0000000000..78936e1a6b --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/dbi_strategies_compare.ipynb @@ -0,0 +1 @@ +../../../../../examples/dbi/dbi_strategies_compare.ipynb \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi_strategy_Ising_model.ipynb b/doc/source/code-examples/tutorials/dbi/dbi_strategy_Ising_model.ipynb new file mode 120000 index 0000000000..f5ee663fd1 --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/dbi_strategy_Ising_model.ipynb @@ -0,0 +1 @@ +../../../../../examples/dbi/dbi_strategy_Ising_model.ipynb \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi_strategy_Pauli-Z.ipynb b/doc/source/code-examples/tutorials/dbi/dbi_strategy_Pauli-Z.ipynb new file mode 120000 index 0000000000..23a3561519 --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/dbi_strategy_Pauli-Z.ipynb @@ -0,0 +1 @@ +../../../../../examples/dbi/dbi_strategy_Pauli-Z.ipynb \ No newline at end of file diff --git a/doc/source/code-examples/tutorials/dbi/dbi_tutorial_basic_intro.ipynb b/doc/source/code-examples/tutorials/dbi/dbi_tutorial_basic_intro.ipynb new file mode 120000 index 0000000000..79ea4d0ea8 --- /dev/null +++ b/doc/source/code-examples/tutorials/dbi/dbi_tutorial_basic_intro.ipynb @@ -0,0 +1 @@ +../../../../../examples/dbi/dbi_tutorial_basic_intro.ipynb \ No newline at end of file diff --git a/examples/dbi/README.md b/examples/dbi/README.md new file mode 100644 index 0000000000..76640ff99f --- /dev/null +++ b/examples/dbi/README.md @@ -0,0 +1,58 @@ +# Double-bracket quantum algorithms + +Qibo features a model implementing double-bracke quantum algorithms (DBQAs) which are helpful for approximating eigenstates based on the ability to run the evolution under the input Hamiltonian. + +More specifically, given a Hamiltonian $H_0$, how can we find a circuit which after applying to the reference state (usually $|0\rangle^{\otimes L}$ for $L$ qubits) will approximate an eigenstate? + +A standard way is to run variational quantum circuits. For example, Qibo already features the `VQE` model [2] which provides the implementation of the variational quantum eigensolver framework. +DBQAs allow to go beyond VQE in that they take a different approach to compiling the quantum circuit approximating the eigenstate. + +## What is the unitary of DBQA? + +Given $H_0$ we begin by assuming that we were given a diagonal and hermitian operator $D_0$ and a time $s_0$. +The `dbi` module provides numerical strategies for selecting them. +For any such choice we define the bracket +$$ W_0 = [D_0, H_0]$$ +and the double-bracket rotation (DBR) of the input Hamiltonian to time $s$ +$$H_0(s) = e^{sW} H e^{- s W}$$ + +### Why are double-bracket rotations useful? +We can show that the magnitude of the off-diagonal norms will decrease. +For this let us set the notation that $\sigma(A)$ is the restriction to the off-diagonal of the matrix A. +In `numpy` this can be implemented by `\sigma(A) = A-np.diag(A)`. In Qibo we implement this as +https://github.com/qiboteam/qibo/blob/8c9c610f5f2190b243dc9120a518a7612709bdbc/src/qibo/models/dbi/double_bracket.py#L145-L147 +which is part of the basic `DoubleBracketIteration` class in the `dbi` module. + +With this notation we next use the Hilbert-Schmidt scalar product and norm to measure the progress of diagonalization + $$||\sigma(H_0(s))||^2- ||\sigma (H_0 )||^2= -2s \langle W, [H,\sigma(H)\rangle+O(s^2)$$ +This equation tells us that as long as the scalar product $\langle W, [H,\sigma(H)\rangle$ is positive then after the DBR the magnitude of the off-diagonal couplings in $H_0(s)$ is less than in $H_0$. + +For the implementation of the DBR unitary $U_0(s) = e^{-s W_0}$ see +https://github.com/qiboteam/qibo/blob/363a6e5e689e5b907a7602bd1cc8d9811c60ee69/src/qibo/models/dbi/double_bracket.py#L68 + +### How to choose $D$? + +For theoretical considerations the canonical bracket is useful. +For this we need the notation of the dephasing channel $\Delta(H)$ which is equivalent to `np.diag(h)`. + $M = [\Delta(H),\sigma(H)]= [H,\sigma(H)]= [\Delta(H),H]$ + The canonical bracket appears on its own in the monotonicity relation above and gives an unconditional reduction of the magnitude of the off-diagonal terms + $$||\sigma(H_0(s))||^2- ||\sigma (H_0 )||^2= -2s ||M||^2+O(s^2)$$ +- the multi qubit Pauli Z generator with $Z(\mu) = (Z_1)^{\mu_1}\ldots (Z_L)^{\mu_L}$ where we optimize over all binary strings $\mu\in \{0,1\}^L$ +- the magnetic field $D = \sum_i B_i Z_i$ +- the two qubit Ising model $D = \sum_i B_i Z_i + \sum_{i,j} J_{i,j} Z_i Z_j$, please follow the tutorial by Matteo and use the QIBO ising model for that with $h=0$ + + +### How to choose s? + +The theory above shows that in generic cases the DBR will have a linear diagonalization effect (as quantified by $||\sigma(H_0(s))||$). +This can be further expanded with Taylor expansion and the Qibo implementation comes with methods for fitting the first local minimum. +Additionally a grid search for the optimal step is provided for an exhaustive evaluation and hyperopt can be used for a more efficient 'unstructured' optimization; additionally simulated annealing is provided which sometimes outperforms hyperopt (and grid search), see example notebooks. +The latter methods may output DBR durations $s_k$ which correspond to secondary local minima. + + + + + +[1] https://arxiv.org/abs/2206.11772 + +[2] https://github.com/qiboteam/vqe-sun diff --git a/examples/dbi/dbi_cost_functions.ipynb b/examples/dbi/dbi_cost_functions.ipynb new file mode 100644 index 0000000000..015a441a94 --- /dev/null +++ b/examples/dbi/dbi_cost_functions.ipynb @@ -0,0 +1,349 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Double-bracket Iteration other cost functions\n", + "\n", + "This notebook presents two additional cost functions for the double-bracket flow: least-squares and energy fluctuation with their respectice scheduling methods." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from copy import deepcopy\n", + "\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "from qibo import hamiltonians, set_backend\n", + "from qibo.models.dbi.double_bracket import DoubleBracketGeneratorType, DoubleBracketScheduling, DoubleBracketIteration, DoubleBracketCostFunction" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Least-squares\n", + "\n", + "The cost function is defined as: $\\frac{1}{2}||D-H_k||^2 =\\frac{1}{2}(||D||^2+||H||^2) -Tr(D H_k)$ as in (the negative of https://epubs.siam.org/doi/abs/10.1137/S0036141092229732?journalCode=sjmael) We seek to minimize this function at each DBF iteration. For numerical optimizations, we also ignore the norm of H term as for a given hamiltonian it is fixed through out the flow.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Hamiltonian\n", + "set_backend(\"numpy\")\n", + "\n", + "# hamiltonian parameters\n", + "nqubits = 5\n", + "h = 3.0\n", + "\n", + "# define the hamiltonian\n", + "H_TFIM = hamiltonians.TFIM(nqubits=nqubits, h=h)\n", + "\n", + "# define the least-squares cost function\n", + "cost = DoubleBracketCostFunction.least_squares\n", + "# initialize class\n", + "dbi = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.single_commutator,cost=cost)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# generate data for plotting sigma decrease of the first step\n", + "d = np.diag(np.linspace(1,2**nqubits,2**nqubits))/2**nqubits\n", + "s_space = np.linspace(1e-5, 1.0, 500)\n", + "off_diagonal_norm_diff = []\n", + "potential = []\n", + "for s in s_space:\n", + " dbi_eval = deepcopy(dbi)\n", + " dbi_eval(s,d=d)\n", + " off_diagonal_norm_diff.append(dbi_eval.off_diagonal_norm - dbi.off_diagonal_norm)\n", + " potential.append(dbi_eval.least_squares(d=d))\n", + "\n", + "# grid_search\n", + "step_grid = dbi.choose_step(scheduling=DoubleBracketScheduling.grid_search,d=d)\n", + "print('grid_search step:', step_grid)\n", + "# hyperopt\n", + "step_hyperopt = dbi.choose_step(scheduling=DoubleBracketScheduling.hyperopt,d=d, max_evals=100, step_max=0.6)\n", + "print('hyperopt_search step:', step_hyperopt)\n", + "# polynomial\n", + "step_poly = dbi.choose_step(scheduling=DoubleBracketScheduling.polynomial_approximation,d=d, n=3)\n", + "print('polynomial_approximation step:', step_poly)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Plot the results\n", + "plt.figure()\n", + "plt.plot(s_space, potential)\n", + "plt.xlabel('s')\n", + "plt.axvline(x=step_grid, color='r', linestyle='-',label='grid_search')\n", + "plt.axvline(x=step_hyperopt, color='g', linestyle='--',label='hyperopt')\n", + "plt.axvline(x=step_poly, color='m', linestyle='-.',label='polynomial')\n", + "plt.title('First DBI step')\n", + "plt.ylabel('Least squares cost function')\n", + "plt.legend()\n", + "plt.figure()\n", + "plt.plot(s_space, off_diagonal_norm_diff)\n", + "plt.axvline(x=step_grid, color='r', linestyle='-',label='grid_search')\n", + "plt.axvline(x=step_hyperopt, color='g', linestyle='--',label='hyperopt')\n", + "plt.axvline(x=step_poly, color='m', linestyle='-.',label='polynomial')\n", + "plt.ylabel(r'$||\\sigma(H_0)||-\\sigma(H_k)||$')\n", + "plt.xlabel('s')\n", + "plt.title('First DBI step')\n", + "plt.legend()\n", + "print('The minimum for cost function in the tested range is:', step_grid)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Comparison of the least-squares cost function with the original cost function using the polynomial scheduling method" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "d = np.diag(np.linspace(1,2**nqubits,2**nqubits))\n", + "off_diagonal_norm_diff = [dbi.off_diagonal_norm]\n", + "off_diagonal_norm_diff_least_squares = [dbi.off_diagonal_norm]\n", + "iters = 100\n", + "dbi_ls = deepcopy(dbi)\n", + "cost = DoubleBracketCostFunction.off_diagonal_norm\n", + "dbi_od = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.single_commutator,cost=cost)\n", + "for _ in range(iters):\n", + " step_poly = dbi_od.choose_step(scheduling=DoubleBracketScheduling.polynomial_approximation, d=d, n=3)\n", + " dbi_od(step_poly,d=d)\n", + " step_poly = dbi_ls.choose_step(scheduling=DoubleBracketScheduling.polynomial_approximation, d=d, n=3)\n", + " dbi_ls(step_poly,d=d)\n", + " off_diagonal_norm_diff.append(dbi_od.off_diagonal_norm)\n", + " off_diagonal_norm_diff_least_squares.append(dbi_ls.off_diagonal_norm)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.figure()\n", + "plt.plot(range(iters+1), off_diagonal_norm_diff, label=r'Off-diagonal norm')\n", + "plt.plot(range(iters+1), off_diagonal_norm_diff_least_squares, label=r'Least squares')\n", + "plt.xlabel('Iterations')\n", + "plt.ylabel(r'$||\\sigma(H_k)||$')\n", + "plt.legend()\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Energy fluctuation\n", + "\n", + "This cost function is defined as: $\\Xi_k^2 (\\mu) = \\langle \\mu | H_k^2| \\mu \\rangle - \\langle \\mu | H_k| \\mu \\rangle^2$. We must specify the state $| \\mu \\rangle$ for which we want to minimize the fluctuation. The overall diagonalization isn't guaranteed.\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Hamiltonian\n", + "set_backend(\"numpy\")\n", + "\n", + "# hamiltonian parameters\n", + "nqubits = 3\n", + "h = 3.0\n", + "\n", + "# define the hamiltonian\n", + "H_TFIM = hamiltonians.TFIM(nqubits=nqubits, h=h)\n", + "\n", + "# define the energy fluctuation cost function\n", + "cost = DoubleBracketCostFunction.off_diagonal_norm\n", + "# define the state\n", + "state = np.zeros(2**nqubits)\n", + "state[3] = 1\n", + "# initialize class\n", + "dbi = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.single_commutator,cost=cost, ref_state=state)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# generate data for plotting sigma decrease of the first step\n", + "d = np.diag(np.linspace(2**nqubits,1,2**nqubits))/2**nqubits\n", + "s_space = np.linspace(-1, 1, 1000)\n", + "off_diagonal_norm_diff = []\n", + "fluctuation = []\n", + "for s in s_space:\n", + " dbi_eval = deepcopy(dbi)\n", + " dbi_eval(s,d=d)\n", + " off_diagonal_norm_diff.append(dbi_eval.off_diagonal_norm - dbi.off_diagonal_norm)\n", + " fluctuation.append(dbi_eval.energy_fluctuation(state=state))\n", + "\n", + "# grid_search\n", + "step_grid = dbi.choose_step(scheduling=DoubleBracketScheduling.grid_search,d=d)\n", + "print('grid_search step:', step_grid)\n", + "# hyperopt\n", + "step_hyperopt = dbi.choose_step(scheduling=DoubleBracketScheduling.hyperopt,d=d, max_evals=100, step_max=0.6)\n", + "print('hyperopt_search step:', step_hyperopt)\n", + "# polynomial\n", + "step_poly = dbi.choose_step(scheduling=DoubleBracketScheduling.polynomial_approximation,d=d, n=3)\n", + "print('polynomial_approximation step:', step_poly)\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Plot the results\n", + "plt.figure()\n", + "plt.plot(s_space, fluctuation)\n", + "plt.xlabel('s')\n", + "plt.axvline(x=step_grid, color='r', linestyle='-',label='grid_search')\n", + "plt.axvline(x=step_hyperopt, color='g', linestyle='--',label ='hyperopt')\n", + "plt.axvline(x=step_poly, color='m', linestyle='-.',label='polynomial')\n", + "plt.title('First DBI step')\n", + "plt.ylabel('Energy fluctuation')\n", + "plt.legend()\n", + "plt.figure()\n", + "plt.plot(s_space, off_diagonal_norm_diff)\n", + "plt.axvline(x=step_grid, color='r', linestyle='-',label='grid_search')\n", + "plt.axvline(x=step_hyperopt, color='g', linestyle='--',label='hyperopt')\n", + "plt.axvline(x=step_poly, color='m', linestyle='-.',label='polynomial')\n", + "plt.ylabel(r'$||\\sigma(H_0)||-\\sigma(H_k)||$')\n", + "plt.xlabel('s')\n", + "plt.title('First DBI step')\n", + "plt.legend()\n", + "print('The minimum for cost function in the tested range is:', step_grid)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "d = np.diag(np.linspace(1,2**nqubits,2**nqubits))\n", + "off_diagonal_norm_diff = [dbi.off_diagonal_norm]\n", + "energy_fluc = [dbi.energy_fluctuation(state=state)]\n", + "iters = 10\n", + "dbi_ = deepcopy(dbi)\n", + "for _ in range(iters):\n", + " step_poly = dbi_.choose_step(scheduling=DoubleBracketScheduling.polynomial_approximation, d=d, n=3)\n", + " dbi_(step_poly,d=d)\n", + " off_diagonal_norm_diff.append(dbi_.off_diagonal_norm)\n", + " energy_fluc.append(dbi_.energy_fluctuation(state=state))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.figure()\n", + "plt.plot(range(iters+1), off_diagonal_norm_diff)\n", + "plt.xlabel('Iterations')\n", + "plt.ylabel(r'$||\\sigma(H_k)||$')\n", + "\n", + "plt.figure()\n", + "plt.plot(range(iters+1), energy_fluc)\n", + "plt.xlabel('Iterations')\n", + "plt.ylabel(r'Energy fluctuation')\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "iters = 30\n", + "states = [0,1,2,3,4,5,6,7]\n", + "energy = np.empty((len(states),iters))\n", + "\n", + "\n", + "d = (np.diag(np.linspace(1,2**nqubits,2**nqubits)))\n", + "for i in range(len(states)):\n", + " dbi_ = deepcopy(dbi)\n", + " dbi_.state = states[i]\n", + " for j in range(iters):\n", + " step_poly = dbi_.choose_step(scheduling=DoubleBracketScheduling.polynomial_approximation, d=d, n=3)\n", + " if step_poly is not None:\n", + " dbi_(step_poly, d=d)\n", + " energy[i,j] = np.real(dbi_.h.matrix[states[i],states[i]])\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "eigvals = np.linalg.eigh(dbi_.h.matrix)[0]\n", + "print('Eigenvalues:', eigvals )\n", + "plt.figure()\n", + "for i in range(len(states)):\n", + " plt.plot(range(iters), energy[i,:],'.', label='State ' + str(states[i]))\n", + "for eigvals in eigvals:\n", + " plt.axhline(y=eigvals, color='r', linestyle='--')\n", + "plt.xlabel('Iterations')\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "test_qibo", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.4" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/dbi/dbi_gradient_descent_strategies.ipynb b/examples/dbi/dbi_gradient_descent_strategies.ipynb new file mode 100644 index 0000000000..58b6ec470b --- /dev/null +++ b/examples/dbi/dbi_gradient_descent_strategies.ipynb @@ -0,0 +1,343 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Double-bracket Gradient Descent Stratgies\n", + "This notebook demonstrates the gradient descent strategies for double-bracket rotations. The mehods uses a numerical method to find the gradient of the cost function with respect to the diagonal operator, and thereby variate the diagonal operator of the rotation. \n", + "\n", + "Finding the gradient requires the parameterization of the diagonal operator, and there are two ways of doing so:\n", + "\n", + "1. Pauli-basis: $D(B,J)= \\sum B_i Z_i + \\sum J_{ij}Z_iZ_j + ...$\n", + "2. Computational-basis: $D(A)=\\sum A_i|i\\rangle\\langle i|$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from qibo.models.dbi.double_bracket import DoubleBracketIteration, DoubleBracketGeneratorType, DoubleBracketScheduling, DoubleBracketCostFunction\n", + "from qibo.models.dbi.utils import generate_pauli_operator_dict, decompose_into_pauli_basis, params_to_diagonal_operator, ParameterizationTypes\n", + "from copy import deepcopy\n", + "from qibo.models.dbi.utils_dbr_strategies import gradient_descent\n", + "import numpy as np\n", + "from qibo import set_backend, hamiltonians\n", + "from qibo.hamiltonians import Hamiltonian\n", + "from qibo.quantum_info import random_hermitian\n", + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def visualize_matrix(matrix, title=\"\"):\n", + " \"\"\"Visualize hamiltonian in a heatmap form.\"\"\"\n", + " fig, ax = plt.subplots(figsize=(5,5))\n", + " ax.set_title(title)\n", + " try:\n", + " im = ax.imshow(np.absolute(matrix), cmap=\"inferno\")\n", + " except TypeError:\n", + " im = ax.imshow(np.absolute(matrix.get()), cmap=\"inferno\")\n", + " fig.colorbar(im, ax=ax)\n", + "\n", + "def s_hist_to_plot(s_hist):\n", + " # convert list of step durations taken to plotable\n", + " s_plot = [0] * len(s_hist)\n", + " for i in range(len(s_hist)):\n", + " if i != 0:\n", + " s_plot[i] = s_plot[i-1] + s_hist[i]\n", + " return s_plot" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Random Hamiltonian" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# set the qibo backend (we suggest qibojit if N >= 20)\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", + "\n", + "# hamiltonian parameters\n", + "nqubits = 5\n", + "seed = 10\n", + "\n", + "# define the hamiltonian\n", + "h0 = random_hermitian(2**nqubits, seed=seed)\n", + "dbi = DoubleBracketIteration(\n", + " Hamiltonian(nqubits, h0),\n", + " mode=DoubleBracketGeneratorType.single_commutator,\n", + " scheduling=DoubleBracketScheduling.hyperopt,\n", + " cost=DoubleBracketCostFunction.off_diagonal_norm\n", + ")\n", + "# vosualize the matrix\n", + "visualize_matrix(dbi.h.matrix, title=\"Target hamiltonian\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Then we set up the required parameters for gradient descent." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Pauli-basis\n", + "pauli_operator_dict = generate_pauli_operator_dict(nqubits)\n", + "pauli_operators = list(pauli_operator_dict.values())\n", + "# let initial d be approximation of $\\Delta(H)\n", + "d_coef_pauli = decompose_into_pauli_basis(dbi.diagonal_h_matrix, pauli_operators=pauli_operators)\n", + "d_pauli = sum([d_coef_pauli[i]*pauli_operators[i] for i in range(nqubits)])\n", + "\n", + "# Computational basis\n", + "d_coef_computational_partial = d_pauli.diagonal()\n", + "d_coef_computational_full = dbi.diagonal_h_matrix.diagonal()\n", + "d_computational_partial = params_to_diagonal_operator(d_coef_computational_partial, nqubits, ParameterizationTypes.computational, normalize=False)\n", + "d_computational_full = params_to_diagonal_operator(d_coef_computational_full, nqubits, ParameterizationTypes.computational, normalize=False)\n", + "\n", + "plt.plot(d_coef_computational_partial, label=\"computational basis partial\")\n", + "plt.plot(d_coef_computational_full, label=r\"computational basis full = $\\Delta(H)$\")\n", + "plt.legend()\n", + "plt.title(r\"Diagonal entries of $D$\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now we want to compare 3 scenarios:\n", + "\n", + "1. Pauli-basis: an approximation to the diagonal of $H$\n", + "2. Computational-partial: same as 1. in the computational basis.\n", + "3. Computational-full: a full parameterization of the diagonal of $H$ in the computational basis." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# 1. Pauli-basis\n", + "NSTEPS = 5\n", + "dbi_pauli = deepcopy(dbi)\n", + "loss_hist_pauli, d_params_hist_pauli, s_hist_pauli = gradient_descent(dbi_pauli, NSTEPS, d_coef_pauli, ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# 2. Computational_partial\n", + "dbi_computational_partial = deepcopy(dbi)\n", + "loss_hist_computational_partial, d_params_hist_computational_partiali, s_computational_partial = gradient_descent(dbi_computational_partial, NSTEPS, d_coef_computational_partial, ParameterizationTypes.computational)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# 3. Computational_full\n", + "dbi_computational_full = deepcopy(dbi)\n", + "loss_hist_computational_full, d_params_hist_computational_full, s_computational_full = gradient_descent(dbi_computational_full, NSTEPS, d_coef_computational_full, ParameterizationTypes.computational)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "s_plot_pauli = s_hist_to_plot(s_hist_pauli)\n", + "s_plot_computational_partial = s_hist_to_plot(s_computational_partial)\n", + "s_plot_computational_full = s_hist_to_plot(s_computational_full)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.plot(s_plot_pauli, loss_hist_pauli, label=\"pauli basis\", marker=\"o\")\n", + "plt.plot(s_plot_computational_partial, loss_hist_computational_partial, label=\"computational partial\", marker=\"o\")\n", + "plt.plot(s_plot_computational_full, loss_hist_computational_full, label=\"computational full\", marker=\"o\")\n", + "plt.legend()\n", + "plt.title(\"Off-diagonal norm\")\n", + "plt.ylabel(r\"$||\\sigma(H)||_{HS}$\")\n", + "plt.xlabel(\"s\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# TFIM" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# hamiltonian parameters\n", + "nqubits = 5\n", + "h = 3\n", + "\n", + "# define the hamiltonian\n", + "h = hamiltonians.TFIM(nqubits=nqubits, h=h)\n", + "dbi = DoubleBracketIteration(\n", + " h,\n", + " mode=DoubleBracketGeneratorType.single_commutator,\n", + " scheduling=DoubleBracketScheduling.hyperopt\n", + ")\n", + "# vosualize the matrix\n", + "visualize_matrix(dbi.h.matrix, title=\"Target hamiltonian\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Pauli-basis\n", + "pauli_operator_dict = generate_pauli_operator_dict(nqubits)\n", + "pauli_operators = list(pauli_operator_dict.values())\n", + "# let initial d be approximation of $\\Delta(H)\n", + "d_coef_pauli = decompose_into_pauli_basis(dbi.diagonal_h_matrix, pauli_operators=pauli_operators)\n", + "d_pauli = sum([d_coef_pauli[i]*pauli_operators[i] for i in range(nqubits)])\n", + "\n", + "# Computational basis\n", + "d_coef_computational_partial = d_pauli.diagonal()\n", + "d_coef_computational_full = dbi.diagonal_h_matrix.diagonal()\n", + "d_computational_partial = params_to_diagonal_operator(d_coef_computational_partial, nqubits, ParameterizationTypes.computational, normalize=False)\n", + "d_computational_full = params_to_diagonal_operator(d_coef_computational_full, nqubits, ParameterizationTypes.computational, normalize=False)\n", + "\n", + "plt.plot(d_coef_computational_partial, label=\"computational basis partial\")\n", + "plt.plot(d_coef_computational_full, label=r\"computational basis full = $\\Delta(H)$\")\n", + "plt.legend()\n", + "plt.title(r\"Diagonal entries of $D$\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# 1. Pauli-basis\n", + "NSTEPS = 3\n", + "dbi_pauli = deepcopy(dbi)\n", + "loss_hist_pauli, d_params_hist_pauli, s_hist_pauli = gradient_descent(dbi_pauli, NSTEPS, d_coef_pauli, ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# 2. Computational_partial\n", + "dbi_computational_partial = deepcopy(dbi)\n", + "loss_hist_computational_partial, d_params_hist_computational_partiali, s_computational_partial = gradient_descent(dbi_computational_partial, NSTEPS, d_coef_computational_partial, ParameterizationTypes.computational)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# 3. Computational_full\n", + "dbi_computational_full = deepcopy(dbi)\n", + "loss_hist_computational_full, d_params_hist_computational_full, s_computational_full = gradient_descent(dbi_computational_full, NSTEPS, d_coef_computational_full, ParameterizationTypes.computational)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "s_plot_pauli = s_hist_to_plot(s_hist_pauli)\n", + "s_plot_computational_partial = s_hist_to_plot(s_computational_partial)\n", + "s_plot_computational_full = s_hist_to_plot(s_computational_full)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.plot(s_plot_pauli, loss_hist_pauli, label=\"pauli basis\", marker=\"o\")\n", + "plt.plot(s_plot_computational_partial, loss_hist_computational_partial, label=\"computational partial\", marker=\"o\")\n", + "plt.plot(s_plot_computational_full, loss_hist_computational_full, label=\"computational full\", marker=\"o\")\n", + "plt.legend()\n", + "plt.title(\"Off-diagonal norm\")\n", + "plt.ylabel(r\"$||\\sigma(H)||_{HS}$\")\n", + "plt.xlabel(\"s\")\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "After changing the cost function and scheduling method, we notice that quite consistently, the Pauli-based parameterization diagonalizes the hamiltonian the best, and for the first few iterations, the Computational-based partial (same initial operator as Pauli) performs very similarly, and diverges later on." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "nqubits = 3\n", + "pauli_operator_dict = generate_pauli_operator_dict(\n", + " nqubits, parameterization_order=1\n", + ")\n", + "params = [1, 2, 3]\n", + "operator_pauli = sum([\n", + " params[i] * list(pauli_operator_dict.values())[i] for i in range(nqubits)\n", + "])\n", + "assert (\n", + " operator_pauli\n", + " == params_to_diagonal_operator(\n", + " params, nqubits=nqubits, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict\n", + " )\n", + ").all()\n", + "operator_element = params_to_diagonal_operator(\n", + " params, nqubits=nqubits, parameterization=ParameterizationTypes.computational\n", + ")\n", + "assert (operator_element.diagonal() == params).all()" + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/dbi/dbi_scheduling.ipynb b/examples/dbi/dbi_scheduling.ipynb new file mode 100644 index 0000000000..fb9d349ebf --- /dev/null +++ b/examples/dbi/dbi_scheduling.ipynb @@ -0,0 +1,455 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Double-bracket Iteration Scheduling Strategies\n", + "\n", + "This notebook presents the different strategies for scheduling the step durations for the double-bracket iteration algorithm and their resepctive accuracies." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Import the dependencies" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from copy import deepcopy\n", + "\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "from qibo import hamiltonians, set_backend\n", + "from qibo.models.dbi.double_bracket import DoubleBracketGeneratorType, DoubleBracketScheduling, DoubleBracketIteration\n", + "from qibo.hamiltonians import SymbolicHamiltonian\n", + "from qibo.models.dbi.utils import str_to_symbolic, generate_Z_operators\n", + "from qibo.models.dbi.utils_scheduling import polynomial_step\n", + "from qibo.models.dbi.utils_dbr_strategies import select_best_dbr_generator" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Canonical\n", + "Set up the basic test case with the transverse field ising model hamiltonian and the canonical bracket as the generator." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Hamiltonian\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", + "\n", + "# hamiltonian parameters\n", + "nqubits = 5\n", + "h = 3\n", + "\n", + "# define the hamiltonian\n", + "H_TFIM = hamiltonians.TFIM(nqubits=nqubits, h=h)\n", + "\n", + "# initialize class\n", + "dbi = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.canonical)\n", + "print(\"Initial off diagonal norm\", dbi.off_diagonal_norm)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We first run a sweep of step duration to map the off-diagonal norm in this range." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# generate data for plotting sigma decrease of the first step\n", + "s_space = np.linspace(1e-5, 0.6, 100)\n", + "off_diagonal_norm_diff = []\n", + "for s in s_space:\n", + " dbi_eval = deepcopy(dbi)\n", + " dbi_eval(s)\n", + " off_diagonal_norm_diff.append(dbi_eval.off_diagonal_norm - dbi.off_diagonal_norm)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "The default scheduling strategy is grid search: `DoubleBracketScheduling.\n", + "grid_serach`. This strategy specifies a list of step durations to test one by one and finds the one that maximizes the cost function (off-digonal norm of Hamiltonian)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# grid_search\n", + "step_grid = dbi.choose_step(scheduling=DoubleBracketScheduling.grid_search)\n", + "print('grid_search step:', step_grid)\n", + "# hyperopt\n", + "step_hyperopt = dbi.choose_step(scheduling=DoubleBracketScheduling.hyperopt, max_evals=100, step_max=0.6)\n", + "print('hyperopt_search step:', step_hyperopt)\n", + "step_poly = dbi.choose_step(scheduling=DoubleBracketScheduling.polynomial_approximation, n=5)\n", + "print('polynomial_approximation step:', step_poly)\n", + "step_sa = dbi.choose_step(scheduling=DoubleBracketScheduling.simulated_annealing)\n", + "print('simulated_annealing step:', step_sa)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Plot the results\n", + "plt.plot(s_space, off_diagonal_norm_diff)\n", + "plt.axvline(x=step_grid, color='r', linestyle='-',label='grid_search')\n", + "plt.axvline(x=step_hyperopt, color='g', linestyle='--',label='hyperopt')\n", + "plt.axvline(x=step_poly, color='m', linestyle='-.',label='polynomial')\n", + "plt.axvline(x=step_sa, color='b', linestyle=':',label='simulated annealing')\n", + "plt.ylabel(r'$||\\sigma(H_0)||-\\sigma(H_k)||$')\n", + "plt.xlabel('s')\n", + "plt.title('First DBI step')\n", + "plt.legend()\n", + "print('The minimum for cost function in the tested range is:', step_grid)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Specified diagonal operator\n", + "\n", + "While for the cannonical case, all the scheduling methods are accurate, it is important to realize that the global minimum of the loss function is not always so obvious. It is thus necessary to show whether the 3 converges to an agreeable step duration using different iteration generators, such as the Pauli 'ZZ..Z' operator and 'ZZ..I' operator." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Generate the digaonal operators\n", + "Z_str = \"Z\"*nqubits\n", + "ZI_str = \"Z\"*(nqubits-1)+\"I\"\n", + "Z_op = SymbolicHamiltonian(str_to_symbolic(Z_str)).dense.matrix\n", + "ZI_op = SymbolicHamiltonian(str_to_symbolic(ZI_str)).dense.matrix\n", + "op_dict = {Z_str:Z_op, ZI_str: ZI_op}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dbi = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.single_commutator)\n", + "d_str = ZI_str\n", + "d = op_dict[d_str]\n", + "# generate data for plotting sigma decrease of the first step\n", + "s_space = np.linspace(1e-5, 0.6, 100)\n", + "off_diagonal_norm_diff = []\n", + "for s in s_space:\n", + " dbi_eval = deepcopy(dbi)\n", + " dbi_eval(s,d=d)\n", + " off_diagonal_norm_diff.append(dbi_eval.off_diagonal_norm - dbi.off_diagonal_norm)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# grid_search\n", + "step_grid = dbi.choose_step(scheduling=DoubleBracketScheduling.grid_search, step_max=0.6, d=d)\n", + "grid_min = dbi.loss(step=step_grid, d=d)-dbi.off_diagonal_norm\n", + "print('grid_search step:', step_grid, 'loss', grid_min)\n", + "# hyperopt\n", + "step_hyperopt = dbi.choose_step(scheduling=DoubleBracketScheduling.hyperopt, d=d, max_evals=100, step_max=0.6)\n", + "hyperopt_min = dbi.loss(step=step_hyperopt, d=d)-dbi.off_diagonal_norm\n", + "print('hyperopt_search step:', step_hyperopt, 'loss', hyperopt_min)\n", + "# polynomial expansion\n", + "step_poly = dbi.choose_step(scheduling=DoubleBracketScheduling.polynomial_approximation, d=d, n=5)\n", + "poly_min = dbi.loss(step=step_poly, d=d)-dbi.off_diagonal_norm\n", + "print('polynomial_approximation step:', step_poly, 'loss', poly_min)\n", + "# simulated annealing\n", + "step_sa = dbi.choose_step(scheduling=DoubleBracketScheduling.simulated_annealing, d=d)\n", + "sa_min = dbi.loss(step=step_sa, d=d)-dbi.off_diagonal_norm\n", + "print('simulated_annealing step:', step_sa, 'loss', sa_min)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Plot the results\n", + "plt.plot(s_space, off_diagonal_norm_diff)\n", + "plt.axvline(x=step_grid, color='r', linestyle='-',label='grid_search')\n", + "plt.text(x=step_grid, y=grid_min, s=f'grid min \\n{round(grid_min,3)}')\n", + "plt.text(x=step_poly, y=poly_min, s=f'poly min \\n{round(poly_min,3)}')\n", + "plt.text(x=step_sa, y=sa_min, s=f'sa min \\n{round(sa_min,3)}')\n", + "plt.axvline(x=step_hyperopt, color='g', linestyle='--',label='hyperopt')\n", + "plt.axvline(x=step_poly, color='m', linestyle='-.',label='polynomial')\n", + "plt.axvline(x=step_sa, color='b', linestyle=':',label='simulated annealing')\n", + "plt.ylabel(r'$||\\sigma(H_0)||-\\sigma(H_k)||$')\n", + "plt.xlabel('s')\n", + "plt.title(f'First DBI step with D={d_str}')\n", + "plt.legend()\n", + "print('The minimum for cost function in the tested range is:', step_grid)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "We see that there are two similar \"minimal point\" at 0.03 and 0.22, with the latter being the absolute minimum by an insignificant advantage. However, for practical reasons, we prefer taking the first close-minimum calculated by polynomial approximation. Hence, we can use the polynomial approximation to restrict the search area and obtain better results. For example, we define a search range of 0.1 around the polynomial step." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Use polynomial expansion as an restriction for hyperopt/grid range" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "search_range = 0.1\n", + "if step_poly < search_range/2:\n", + " step_min = 0\n", + " step_max = search_range\n", + "else:\n", + " step_min = step_poly - search_range/2\n", + " step_max = step_poly + search_range/2\n", + "# grid_search\n", + "step_grid = dbi.choose_step(scheduling=DoubleBracketScheduling.grid_search, step_min=step_min, step_max=step_max, d=d)\n", + "print('grid_search step:', step_grid)\n", + "# hyperopt\n", + "step_hyperopt = dbi.choose_step(scheduling=DoubleBracketScheduling.hyperopt, step_min=step_min, step_max=step_max, max_evals=100, d=d,)\n", + "print('hyperopt_search step:', step_hyperopt)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Plot the results\n", + "plt.plot(s_space, off_diagonal_norm_diff)\n", + "plt.axvline(x=step_grid, color='r', linestyle='-',label='grid_search')\n", + "plt.axvline(x=step_hyperopt, color='g', linestyle='--',label='hyperopt')\n", + "plt.axvline(x=step_poly, color='m', linestyle='-.',label='polynomial')\n", + "plt.ylabel(r'$||\\sigma(H_0)||-\\sigma(H_k)||$')\n", + "plt.xlabel('s')\n", + "plt.title(r'Restrict $s$ with polynomial')\n", + "plt.legend()\n", + "print('The minimum for cost function in the tested range is:', step_grid)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Hence, we see that the strategy is indeed effective for finding the first minimum of the loss funciton for both the Z operator and the ZI operator." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Compare in Pauli-Z strategy" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from qibo.quantum_info import random_hermitian\n", + "from qibo.hamiltonians import Hamiltonian" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Hamiltonian\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", + "nqubits = 4\n", + "h0 = random_hermitian(2**nqubits)\n", + "\n", + "# initialize class\n", + "dbi = DoubleBracketIteration(deepcopy(Hamiltonian(nqubits=nqubits, matrix=h0)),mode=DoubleBracketGeneratorType.single_commutator)\n", + "print(\"Initial off diagonal norm\", dbi.off_diagonal_norm)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "generate_local_Z = generate_Z_operators(nqubits)\n", + "Z_ops = list(generate_local_Z.values())\n", + "Z_names = list(generate_local_Z.keys())" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "NSTEPS = 3\n", + "scheduling_list = [DoubleBracketScheduling.grid_search,\n", + " DoubleBracketScheduling.hyperopt,\n", + " DoubleBracketScheduling.polynomial_approximation,\n", + " DoubleBracketScheduling.simulated_annealing,]\n", + "scheduling_labels = ['grid search',\n", + " 'hyperopt',\n", + " 'polynomial',\n", + " 'simulated_annealing']\n", + "Z_optimal_scheduling = []\n", + "s_scheduling = []\n", + "off_norm_scheduling =[]\n", + "for i,scheduling in enumerate(scheduling_list):\n", + " # reinitialize\n", + " dbi = DoubleBracketIteration(Hamiltonian(nqubits=nqubits, matrix=deepcopy(h0)), mode=DoubleBracketGeneratorType.single_commutator)\n", + " Z_optimal = []\n", + " # add in initial values for plotting\n", + " off_diagonal_norm_history = [dbi.off_diagonal_norm]\n", + " steps = [0]\n", + " print(f'----------Scheduling {scheduling_labels[i]}----------')\n", + " for _ in range(NSTEPS):\n", + " dbi, idx, step, flip_sign = select_best_dbr_generator(dbi, Z_ops, scheduling=scheduling, compare_canonical=False)\n", + " off_diagonal_norm_history.append(dbi.off_diagonal_norm)\n", + " steps.append(steps[-1]+step)\n", + " if flip_sign < 0:\n", + " Z_optimal.append('-' + Z_names[idx])\n", + " else:\n", + " Z_optimal.append(Z_names[idx])\n", + " print(f\"New optimized step at iteration {_+1}/{NSTEPS}: {step} with operator {Z_optimal[-1]}, loss {dbi.off_diagonal_norm}\")\n", + " Z_optimal_scheduling.append(Z_optimal)\n", + " s_scheduling.append(steps)\n", + " off_norm_scheduling.append(off_diagonal_norm_history)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.figure()\n", + "for i, scheduling in enumerate(scheduling_labels):\n", + " plt.plot(s_scheduling[i], off_norm_scheduling[i], '-o', label=scheduling)\n", + "plt.xlabel(\"Step durations\")\n", + "plt.ylabel(\"Norm off-diagonal restriction\")\n", + "plt.title(\"Compare Variational Pauli-Z using different scheduling strategies\")\n", + "plt.legend()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## When polynomial approximation has no solution\n", + "\n", + "In some cases, the prescribed taylor expansion order `n` may not be sufficient to produce a meaningful step duration (real positive). In these cases, we rely on a backup scheduling method in `choose_step`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Hamiltonian\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", + "\n", + "# hamiltonian parameters\n", + "nqubits = 5\n", + "h = 3\n", + "\n", + "# define the hamiltonian\n", + "H_TFIM = hamiltonians.TFIM(nqubits=nqubits, h=h)\n", + "\n", + "# initialize class\n", + "dbi = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.canonical)\n", + "dbi.scheduling = DoubleBracketScheduling.polynomial_approximation\n", + "print(\"Initial off diagonal norm\", dbi.off_diagonal_norm)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "For demonstration purposes, we let `n=1` which is a linear fit to the loss function. This results in no valid solutions and function `polynomial_step` returns `None`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "for n in range (5):\n", + " step = polynomial_step(dbi, n=n)\n", + " print(n, step)\n", + "print(dbi.choose_step(n=1))" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/dbi/dbi_strategies_compare.ipynb b/examples/dbi/dbi_strategies_compare.ipynb new file mode 100644 index 0000000000..4a60ea3034 --- /dev/null +++ b/examples/dbi/dbi_strategies_compare.ipynb @@ -0,0 +1,464 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# DBI strategies comparison\n", + "\n", + "This notebook is a comparison of the so-far developed diagonalization strategies for DBI, including the canonical, Pauli-Z, and magnetic field strategies. On top of these, we also show case the use of invariant DBI generators such as 'BHMM'." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "\n", + "from copy import deepcopy\n", + "\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "from qibo import symbols\n", + "from qibo import hamiltonians, set_backend\n", + "from qibo.hamiltonians import Hamiltonian, SymbolicHamiltonian\n", + "from qibo.quantum_info import random_hermitian\n", + "from qibo.models.dbi.double_bracket import DoubleBracketGeneratorType, DoubleBracketScheduling, DoubleBracketIteration, DoubleBracketCostFunction\n", + "from qibo.models.dbi.utils import generate_Z_operators, generate_pauli_operator_dict, decompose_into_pauli_basis, ParameterizationTypes\n", + "from qibo.models.dbi.utils_dbr_strategies import select_best_dbr_generator, gradient_descent, polynomial_step" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def visualize_matrix(matrix, title=\"\"):\n", + " \"\"\"Visualize hamiltonian in a heatmap form.\"\"\"\n", + " fig, ax = plt.subplots(figsize=(5,5))\n", + " ax.set_title(title)\n", + " try:\n", + " im = ax.imshow(np.absolute(matrix), cmap=\"inferno\")\n", + " except TypeError:\n", + " im = ax.imshow(np.absolute(matrix.get()), cmap=\"inferno\")\n", + " fig.colorbar(im, ax=ax)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Test on random Hamiltonian\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# backend\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", + "# initialize dbi object\n", + "nqubits = 5\n", + "h0 = random_hermitian(2**nqubits, seed=2)\n", + "dbi = DoubleBracketIteration(Hamiltonian(nqubits=nqubits, matrix=h0))\n", + "cost = DoubleBracketCostFunction.off_diagonal_norm\n", + "print(\"Initial loss\", dbi.least_squares(d=dbi.diagonal_h_matrix))\n", + "visualize_matrix(dbi.h.matrix, title=f'Random hamiltonian with L={nqubits}')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# iterations steps\n", + "NSTEPS = 5\n", + "# choose polynomial scheduling\n", + "scheduling = DoubleBracketScheduling.simulated_annealing" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Canonical" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# initialize DBI class for the canonical case\n", + "dbi_canonical = DoubleBracketIteration(Hamiltonian(nqubits=nqubits, matrix=h0), mode=DoubleBracketGeneratorType.canonical, scheduling=scheduling, cost=cost)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Canonical\n", + "loss_history_canonical = [dbi_canonical.off_diagonal_norm]\n", + "steps_canonical_plot = [0]\n", + "for s in range(NSTEPS):\n", + " # same settings as iteration from list\n", + " d = dbi.diagonal_h_matrix\n", + " step = dbi_canonical.choose_step(d=d)\n", + " dbi_canonical(step=step)\n", + " print(f\"New optimized step at iteration {s+1}/{NSTEPS}: {step}, loss {dbi_canonical.off_diagonal_norm}\")\n", + " loss_history_canonical.append(dbi_canonical.off_diagonal_norm)\n", + " steps_canonical_plot.append(steps_canonical_plot[-1]+step)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Pauli-Z" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# initialize DBI class for the Pauli-Z strategy\n", + "dbi_pauli = DoubleBracketIteration(Hamiltonian(nqubits=nqubits, matrix=h0), mode=DoubleBracketGeneratorType.single_commutator, scheduling=scheduling, cost=cost)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "generate_local_Z = generate_Z_operators(nqubits)\n", + "Z_ops = list(generate_local_Z.values())\n", + "Z_names = list(generate_local_Z.keys())\n", + "Z_optimal = []\n", + "# add in initial values for plotting\n", + "loss_history_pauli = [dbi_pauli.off_diagonal_norm]\n", + "steps_pauli_plot = [0]\n", + "scheduling = DoubleBracketScheduling.simulated_annealing\n", + "for _ in range(NSTEPS):\n", + " dbi_pauli, idx, step, flip_sign = select_best_dbr_generator(dbi_pauli, Z_ops, scheduling=scheduling, compare_canonical=False)\n", + " d = Z_ops[idx]\n", + " loss_history_pauli.append(dbi_pauli.off_diagonal_norm)\n", + " steps_pauli_plot.append(steps_pauli_plot[-1]+step)\n", + " if flip_sign < 0:\n", + " Z_optimal.append('-' + Z_names[idx])\n", + " else:\n", + " Z_optimal.append(Z_names[idx])\n", + " print(f\"New optimized step at iteration {_+1}/{NSTEPS}: {step} with operator {Z_optimal[-1]}, loss {dbi_pauli.off_diagonal_norm}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Magnetic field" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# initialize DBI class for the canonical case\n", + "dbi_gradient = DoubleBracketIteration(Hamiltonian(nqubits=nqubits, matrix=h0), mode=DoubleBracketGeneratorType.single_commutator, scheduling=scheduling, cost=cost)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pauli_operator_dict = generate_pauli_operator_dict(nqubits=nqubits, parameterization_order=2)\n", + "d_coef = decompose_into_pauli_basis(dbi.h.matrix, list(pauli_operator_dict.values()))\n", + "d = sum([d_coef[i] * list(pauli_operator_dict.values())[i] for i in range(nqubits)])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def s_hist_to_plot(s_hist):\n", + " # convert list of step durations taken to plotable\n", + " s_plot = [0] * len(s_hist)\n", + " for i in range(len(s_hist)):\n", + " if i != 0:\n", + " s_plot[i] = s_plot[i-1] + s_hist[i]\n", + " return s_plot" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "loss_history_gradient, d_params_hist, s_hist = gradient_descent(dbi_gradient, NSTEPS, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)\n", + "steps_gradient_plot = s_hist_to_plot(s_hist)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.title(str(nqubits) + ' random Hamiltonian diagonalization')\n", + "plt.plot(loss_history_canonical, label='canonical')\n", + "plt.plot(loss_history_pauli, label='Pauli-Z')\n", + "plt.plot(loss_history_gradient, label='gradient')\n", + "plt.legend()\n", + "plt.xlabel('Iteration')\n", + "plt.ylabel(r'$|| \\sigma(e^{sW}He^{-sW}) || $')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.title(str(nqubits) + ' random Hamiltonian diagonalization')\n", + "plt.plot(steps_canonical_plot, loss_history_canonical, marker='o', label='canonical')\n", + "plt.plot(steps_pauli_plot, loss_history_pauli, marker='o', label='Pauli-Z')\n", + "plt.plot(steps_gradient_plot,loss_history_gradient, marker='o', label='gradient')\n", + "plt.legend()\n", + "plt.xlabel('Iteration')\n", + "plt.ylabel(r'$|| \\sigma(e^{sW}He^{-sW}) || $')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Test on TFIM\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# backend\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", + "# initialize dbi object\n", + "# hamiltonian parameters\n", + "# define the hamiltonian\n", + "nqubits = 5\n", + "h = 1\n", + "H_TFIM = SymbolicHamiltonian( - h*symbols.Z(nqubits-1), nqubits=nqubits)\n", + "# add linear interaction terms\n", + "for i in range(nqubits-1):\n", + " H_TFIM -= SymbolicHamiltonian(symbols.X(i)*symbols.X(i+1) + h*symbols.Z(i), nqubits=nqubits)\n", + "H_TFIM = H_TFIM.dense\n", + "\n", + "# initialize class\n", + "dbi = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.canonical)\n", + "print(\"Initial off diagonal norm\", dbi.off_diagonal_norm)\n", + "visualize_matrix(dbi.h.matrix, title=f'Random hamiltonian with L={nqubits}')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# iterations steps\n", + "NSTEPS = 5\n", + "# choose polynomial scheduling\n", + "scheduling = DoubleBracketScheduling.simulated_annealing" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Canonical" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# initialize DBI class for the canonical case\n", + "dbi_canonical = DoubleBracketIteration(deepcopy(H_TFIM), mode=DoubleBracketGeneratorType.canonical, scheduling=scheduling)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Canonical\n", + "off_diagonal_norm_history_canonical = [dbi_canonical.off_diagonal_norm]\n", + "steps_canonical_plot = [0]\n", + "for s in range(NSTEPS):\n", + " # same settings as iteration from list\n", + " step = dbi_canonical.choose_step(d=dbi.diagonal_h_matrix)\n", + " dbi_canonical(step=step)\n", + " print(f\"New optimized step at iteration {s+1}/{NSTEPS}: {step}, loss {dbi_canonical.off_diagonal_norm}\")\n", + " off_diagonal_norm_history_canonical.append(dbi_canonical.off_diagonal_norm)\n", + " steps_canonical_plot.append(steps_canonical_plot[-1]+step)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Pauli-Z" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# initialize DBI class for the Pauli-Z strategy\n", + "dbi_pauli = DoubleBracketIteration(deepcopy(H_TFIM), mode=DoubleBracketGeneratorType.single_commutator, scheduling=scheduling)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "generate_local_Z = generate_Z_operators(nqubits)\n", + "Z_ops = list(generate_local_Z.values())\n", + "Z_names = list(generate_local_Z.keys())\n", + "Z_optimal = []\n", + "# add in initial values for plotting\n", + "off_diagonal_norm_history_pauli = [dbi_pauli.off_diagonal_norm]\n", + "steps_pauli_plot = [0]\n", + "scheduling = DoubleBracketScheduling.simulated_annealing\n", + "for _ in range(NSTEPS):\n", + " dbi_pauli, idx, step, flip_sign = select_best_dbr_generator(dbi_pauli, Z_ops, scheduling=scheduling, compare_canonical=False)\n", + " off_diagonal_norm_history_pauli.append(dbi_pauli.off_diagonal_norm)\n", + " steps_pauli_plot.append(steps_pauli_plot[-1]+step)\n", + " if flip_sign < 0:\n", + " Z_optimal.append('-' + Z_names[idx])\n", + " else:\n", + " Z_optimal.append(Z_names[idx])\n", + " print(f\"New optimized step at iteration {_+1}/{NSTEPS}: {step} with operator {Z_optimal[-1]}, loss {dbi_pauli.off_diagonal_norm}\")" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Magnetic field" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# initialize DBI class for the canonical case\n", + "dbi_gradient = DoubleBracketIteration(deepcopy(H_TFIM), mode=DoubleBracketGeneratorType.single_commutator, scheduling=scheduling)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "pauli_operator_dict = generate_pauli_operator_dict(nqubits=nqubits, parameterization_order=2)\n", + "d_coef = decompose_into_pauli_basis(dbi.h.matrix, list(pauli_operator_dict.values()))\n", + "d = sum([d_coef[i] * list(pauli_operator_dict.values())[i] for i in range(nqubits)])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "initial_s = polynomial_step(dbi_object=dbi, d=d, n=4)\n", + "print(initial_s)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "off_diagonal_norm_history_gradient, d_params_hist, s_hist = gradient_descent(dbi_gradient, NSTEPS, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)\n", + "steps_gradient_plot = s_hist_to_plot(s_hist)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.title(str(nqubits) + ' random Hamiltonian diagonalization')\n", + "plt.plot(off_diagonal_norm_history_canonical, label='canonical', marker='o')\n", + "plt.plot(off_diagonal_norm_history_pauli, label='Pauli-Z', marker='o')\n", + "plt.plot(off_diagonal_norm_history_gradient, label='gradient', marker='o')\n", + "plt.legend()\n", + "plt.xlabel('Iteration')\n", + "plt.ylabel(r'$|| \\sigma(e^{sW}He^{-sW}) || $')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.title(str(nqubits) + ' random Hamiltonian diagonalization')\n", + "plt.plot(steps_canonical_plot, off_diagonal_norm_history_canonical, marker='o', label='canonical')\n", + "plt.plot(steps_pauli_plot, off_diagonal_norm_history_pauli, marker='o', label='Pauli-Z')\n", + "plt.plot(steps_gradient_plot,off_diagonal_norm_history_gradient, marker='o', label='gradient')\n", + "plt.legend()\n", + "plt.xlabel('Duration')\n", + "plt.ylabel(r'$|| \\sigma(e^{sW}He^{-sW}) || $')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/dbi/dbi_strategy_Ising_model.ipynb b/examples/dbi/dbi_strategy_Ising_model.ipynb new file mode 100644 index 0000000000..6c0d53209a --- /dev/null +++ b/examples/dbi/dbi_strategy_Ising_model.ipynb @@ -0,0 +1,328 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Double-Bracket Iteration Strategy: magnetic field (Ising model)\n", + "This notebook shows the diagonalization process of DBI using the magnetic field strategy, which varies the diagonal operator $D$ by gradient descent. To find the gradient with respect to $D$, parameterization of $D$ is required. For the purpose of this notebook, we represent it by the Ising model, i.e.\n", + "\n", + "$$ D = \\sum \\alpha_i Z_i +\\sum \\beta_{ij}Z_iZ_j$$\n", + "\n", + "\n", + "The gradients are calculated under the premise that the diagonalization gain curve can be fitted by a polynomial, and that the iteration step duration is taken at the first dip of the curve." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "from copy import deepcopy\n", + "\n", + "import numpy as np\n", + "import matplotlib.pyplot as plt\n", + "\n", + "from qibo import hamiltonians, set_backend, symbols\n", + "from qibo.hamiltonians import Hamiltonian, SymbolicHamiltonian\n", + "from qibo.quantum_info import random_hermitian\n", + "from qibo.models.dbi.double_bracket import DoubleBracketGeneratorType, DoubleBracketScheduling, DoubleBracketIteration\n", + "from qibo.models.dbi.utils import generate_pauli_operator_dict, decompose_into_pauli_basis, ParameterizationTypes\n", + "from qibo.models.dbi.utils_dbr_strategies import gradient_numerical, gradient_descent" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "def visualize_matrix(matrix, title=\"\"):\n", + " \"\"\"Visualize hamiltonian in a heatmap form.\"\"\"\n", + " fig, ax = plt.subplots(figsize=(5,5))\n", + " ax.set_title(title)\n", + " try:\n", + " im = ax.imshow(np.absolute(matrix), cmap=\"inferno\")\n", + " except TypeError:\n", + " im = ax.imshow(np.absolute(matrix.get()), cmap=\"inferno\")\n", + " fig.colorbar(im, ax=ax)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Test on random Hamiltonian" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# backend\n", + "set_backend(\"numpy\")\n", + "# initialize dbi object\n", + "nqubits = 5\n", + "h0 = random_hermitian(2**nqubits, seed=2)\n", + "scheduling = DoubleBracketScheduling.hyperopt\n", + "mode = DoubleBracketGeneratorType.single_commutator\n", + "n_taylor = 5\n", + "dbi = DoubleBracketIteration(Hamiltonian(nqubits=nqubits, matrix=h0), scheduling=scheduling, mode=mode)\n", + "print(\"Initial off diagonal norm\", dbi.off_diagonal_norm)\n", + "visualize_matrix(dbi.h.matrix, title=f'Random hamiltonian with L={nqubits}')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Order 1: $D=\\sum \\alpha_iZ_i$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# generate pauli_operator_dict\n", + "pauli_operator_dict = generate_pauli_operator_dict(nqubits=nqubits, parameterization_order=1)\n", + "d_coef = decompose_into_pauli_basis(dbi.h.matrix, list(pauli_operator_dict.values()))\n", + "d = sum([d_coef[i] * list(pauli_operator_dict.values())[i] for i in range(nqubits)])\n", + "grad = gradient_numerical(dbi, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)\n", + "print('The initial D coefficients:', d_coef)\n", + "print('Gradient:', grad)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "iters = 15\n", + "off_diagonal_norm_1, d_params_hist, s_step = gradient_descent(dbi, iters, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.title(str(nqubits) + ' spins random hamiltonian')\n", + "plt.plot(off_diagonal_norm_1)\n", + "plt.xlabel('Iteration')\n", + "plt.ylabel(r'$|| \\sigma(e^{sW}He^{-sW}) || $')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Order 2: $D=\\sum \\alpha_iZ_i + \\beta_{ij}Z_iZ_j$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dbi = DoubleBracketIteration(Hamiltonian(nqubits=nqubits, matrix=h0), scheduling=scheduling, mode=mode)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# generate pauli_operator_dict\n", + "pauli_operator_dict = generate_pauli_operator_dict(nqubits=nqubits, parameterization_order=2)\n", + "d_coef = decompose_into_pauli_basis(dbi.h.matrix, list(pauli_operator_dict.values()))\n", + "d = sum([d_coef[i] * list(pauli_operator_dict.values())[i] for i in range(nqubits)])\n", + "grad = gradient_numerical(dbi, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)\n", + "print('The initial D coefficients:', d_coef)\n", + "print('Gradient:', grad)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "iters = 15\n", + "off_diagonal_norm_2, d_params_hist, s_step = gradient_descent(dbi, iters, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.title(str(nqubits) + ' spins random hamiltonian')\n", + "plt.plot(off_diagonal_norm_1, label='order 1')\n", + "plt.plot(off_diagonal_norm_2, label='order 2')\n", + "plt.legend()\n", + "plt.xlabel('Iteration')\n", + "plt.ylabel(r'$|| \\sigma(e^{sW}He^{-sW}) || $')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Test on TFIM\n", + "Here we choose to customize our TFIM in the X axis using `SymbolicHamiltonian`. It is also possible to use Hadamard gate to rotate the TFIM inbuilt in `qibo`.\n", + "\n", + "$$ H = -(\\sum X_i X_{i+1} + \\sum hZ_i)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# generate the Hamiltonian\n", + "nqubits = 5\n", + "h = 1\n", + "H_TFIM = SymbolicHamiltonian( - h*symbols.Z(nqubits-1), nqubits=nqubits)\n", + "# add linear interaction terms\n", + "for i in range(nqubits-1):\n", + " H_TFIM -= SymbolicHamiltonian(symbols.X(i)*symbols.X(i+1) + h*symbols.Z(i), nqubits=nqubits)\n", + "H_TFIM = H_TFIM.dense\n", + "visualize_matrix(H_TFIM.matrix, title=f'TFIM with L={nqubits} h={h}')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# backend\n", + "set_backend(\"numpy\")\n", + "# initialize dbi object\n", + "dbi_TFIM = DoubleBracketIteration(deepcopy(H_TFIM), scheduling=scheduling, mode=mode)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Order 1: $D=\\sum \\alpha_iZ_i$" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dbi_TFIM_1 = DoubleBracketIteration(deepcopy(H_TFIM), scheduling=scheduling, mode=mode)\n", + "# generate pauli_operator_dict\n", + "pauli_operator_dict = generate_pauli_operator_dict(nqubits=nqubits, parameterization_order=1)\n", + "d_coef = decompose_into_pauli_basis(dbi_TFIM_1.h.matrix, list(pauli_operator_dict.values()))\n", + "d = sum([d_coef[i] * list(pauli_operator_dict.values())[i] for i in range(nqubits)])\n", + "grad = gradient_numerical(dbi_TFIM_1, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)\n", + "print('The initial D coefficients:', d_coef)\n", + "print('Gradient:', grad)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "NSTEPS = 3\n", + "off_diagonal_norm_1, d_params_hist, s_step = gradient_descent(dbi_TFIM_1, NSTEPS, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.title(f'n={nqubits} h={h} TFIM, order=1')\n", + "plt.plot(off_diagonal_norm_1)\n", + "plt.xlabel('Iteration')\n", + "plt.ylabel(r'$|| \\sigma(e^{sW}He^{-sW}) || $')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# the final matrix\n", + "visualize_matrix(dbi_TFIM.h.matrix)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Order 2" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "dbi_TFIM_2 = DoubleBracketIteration(deepcopy(H_TFIM), scheduling=scheduling, mode=mode)\n", + "# generate pauli_operator_dict\n", + "pauli_operator_dict = generate_pauli_operator_dict(nqubits=nqubits, parameterization_order=2)\n", + "d_coef = decompose_into_pauli_basis(dbi_TFIM_2.h.matrix, list(pauli_operator_dict.values()))\n", + "d = sum([d_coef[i] * list(pauli_operator_dict.values())[i] for i in range(nqubits)])\n", + "grad = gradient_numerical(dbi_TFIM_2, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)\n", + "print('The initial D coefficients:', d_coef)\n", + "print('Gradient:', grad)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "off_diagonal_norm_2, d_params_hist, s_step = gradient_descent(dbi_TFIM_2, NSTEPS, d_coef, parameterization=ParameterizationTypes.pauli, pauli_operator_dict=pauli_operator_dict)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "plt.title(f'n={nqubits} h={h} TFIM')\n", + "plt.plot(off_diagonal_norm_1, label='order 1')\n", + "plt.plot(off_diagonal_norm_2, label='order 2')\n", + "plt.legend()\n", + "plt.xlabel('Iteration')\n", + "plt.ylabel(r'$|| \\sigma(e^{sW}He^{-sW}) || $')" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In conclusion, we see that the parameterization order or locality of the Pauli based parameterization for gradient descent does not affect significantly the effectiveness of double bracket diagonalization." + ] + } + ], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/examples/dbi/DBI_strategy_Pauli-Z_products.ipynb b/examples/dbi/dbi_strategy_Pauli-Z.ipynb similarity index 87% rename from examples/dbi/DBI_strategy_Pauli-Z_products.ipynb rename to examples/dbi/dbi_strategy_Pauli-Z.ipynb index 0f76a36245..aabee6c172 100644 --- a/examples/dbi/DBI_strategy_Pauli-Z_products.ipynb +++ b/examples/dbi/dbi_strategy_Pauli-Z.ipynb @@ -22,13 +22,12 @@ "metadata": {}, "outputs": [], "source": [ - "!python -m pip install seaborn # plotting library\n", - "!python -m pip install hyperopt # required to optimize the DBF step" + "# !python -m pip install seaborn # plotting library" ] }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "metadata": {}, "outputs": [], "source": [ @@ -39,8 +38,9 @@ "import seaborn as sns\n", "\n", "from qibo import hamiltonians, set_backend\n", - "from qibo.models.dbi.double_bracket import DoubleBracketGeneratorType, DoubleBracketIteration\n", - "from qibo.models.dbi.utils import *" + "from qibo.models.dbi.double_bracket import DoubleBracketGeneratorType, DoubleBracketIteration, DoubleBracketScheduling\n", + "from qibo.models.dbi.utils import generate_Z_operators\n", + "from qibo.models.dbi.utils_dbr_strategies import select_best_dbr_generator" ] }, { @@ -122,31 +122,16 @@ }, { "cell_type": "code", - "execution_count": 9, - "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "[Qibo 0.2.4|INFO|2024-01-24 19:59:31]: Using qibojit (numba) backend on /CPU:0\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Initial off diagonal norm 8.48528137423857\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "# set the qibo backend (we suggest qibojit if N >= 20)\n", "# alternatives: tensorflow (not optimized), numpy (when CPU not supported by jit)\n", - "set_backend(\"qibojit\", \"numba\")\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", "\n", "# hamiltonian parameters\n", - "nqubits = 2\n", + "nqubits = 5\n", "h = 3\n", "\n", "# define the hamiltonian\n", @@ -160,20 +145,9 @@ }, { "cell_type": "code", - "execution_count": 8, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "[[-2.-0.j -0.-0.j -0.-0.j -0.-0.j]\n", - " [-0.-0.j 2.-0.j -0.-0.j -0.-0.j]\n", - " [-0.-0.j -0.-0.j 2.-0.j -0.-0.j]\n", - " [-0.-0.j -0.-0.j -0.-0.j -2.-0.j]]\n" - ] - } - ], + "execution_count": null, + "metadata": {}, + "outputs": [], "source": [ "print(H_TFIM.matrix)" ] @@ -212,15 +186,16 @@ "metadata": {}, "outputs": [], "source": [ - "NSTEPS = 15\n", - "max_evals = 100\n", + "NSTEPS = 2\n", + "max_evals = 10\n", "step_max = 1\n", "Z_optimal = []\n", "# add in initial values for plotting\n", "off_diagonal_norm_history = [dbi.off_diagonal_norm]\n", "steps = [0]\n", + "scheduling = DoubleBracketScheduling.hyperopt\n", "for _ in range(NSTEPS):\n", - " dbi, idx, step, flip_sign = select_best_dbr_generator(dbi, Z_ops, compare_canonical=False, max_evals=max_evals, step_max=step_max)\n", + " dbi, idx, step, flip_sign = select_best_dbr_generator(dbi, Z_ops, scheduling=scheduling, compare_canonical=False, max_evals=max_evals, step_max=step_max)\n", " off_diagonal_norm_history.append(dbi.off_diagonal_norm)\n", " steps.append(steps[-1]+step)\n", " if flip_sign < 0:\n", @@ -269,7 +244,7 @@ "source": [ "# set the qibo backend (we suggest qibojit if N >= 20)\n", "# alternatives: tensorflow (not optimized), numpy (when CPU not supported by jit)\n", - "set_backend(\"qibojit\", \"numba\")\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", "\n", "\n", "# initialize class|\n", @@ -289,13 +264,7 @@ "steps_canonical_plot = [0]\n", "for s in range(NSTEPS):\n", " # same settings as iteration from list\n", - " step = dbi_canonical.hyperopt_step(\n", - " step_min = 1e-5,\n", - " step_max = 1,\n", - " space = hp.uniform,\n", - " optimizer = tpe,\n", - " max_evals = max_evals,\n", - " )\n", + " step = dbi_canonical.choose_step(scheduling=DoubleBracketScheduling.hyperopt)\n", " dbi_canonical(step=step)\n", " print(f\"New optimized step at iteration {s+1}/{NSTEPS}: {step}, loss {dbi_canonical.off_diagonal_norm}\")\n", " off_diagonal_norm_history_canonical.append(dbi_canonical.off_diagonal_norm)\n", @@ -355,7 +324,7 @@ "metadata": {}, "outputs": [], "source": [ - "dbi_mixed = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.single_commutator)\n", + "dbi_mixed = DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.single_commutator, scheduling=DoubleBracketScheduling.hyperopt)\n", "print(\"Initial off diagonal norm\", dbi_mixed.off_diagonal_norm)" ] }, @@ -368,12 +337,7 @@ "dbi_eval = deepcopy(dbi_mixed)\n", "dbi_eval.mode = DoubleBracketGeneratorType.canonical\n", "if step is None:\n", - " step = dbi_eval.hyperopt_step(\n", - " step_max=step_max,\n", - " space=hp.uniform,\n", - " optimizer=tpe,\n", - " max_evals=max_evals,\n", - " )\n", + " step = dbi_eval.choose_step()\n", "dbi_eval(step=step)\n", "print('canonical norm', dbi_eval.off_diagonal_norm, 'step', step)" ] @@ -389,7 +353,7 @@ "off_diagonal_norm_history_mixed = [dbi_mixed.off_diagonal_norm]\n", "steps = [0]\n", "for _ in range(NSTEPS):\n", - " dbi_mixed, idx, step, flip_sign = select_best_dbr_generator(dbi_mixed, Z_ops, compare_canonical=True, max_evals=max_evals)\n", + " dbi_mixed, idx, step, flip_sign = select_best_dbr_generator(dbi_mixed, Z_ops, scheduling=scheduling, compare_canonical=True, max_evals=max_evals, step_max=step_max)\n", " off_diagonal_norm_history_mixed.append(dbi_mixed.off_diagonal_norm)\n", " steps.append(steps[-1]+step)\n", " if idx == len(Z_ops):\n", @@ -444,7 +408,7 @@ "metadata": {}, "outputs": [], "source": [ - "dbi_mixed_can= DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.canonical)\n", + "dbi_mixed_can= DoubleBracketIteration(deepcopy(H_TFIM),mode=DoubleBracketGeneratorType.canonical, scheduling=DoubleBracketScheduling.hyperopt)\n", "print(\"Initial off diagonal norm\", dbi_mixed_can.off_diagonal_norm)" ] }, @@ -463,7 +427,7 @@ " dbi_mixed_can(step=step)\n", " off_diagonal_norm_history_mixed_can.append(dbi_mixed_can.off_diagonal_norm)\n", " steps_mixed_can.append(step)\n", - " \n", + "\n", "print(\"After 2 steps, off diagonal norm:\", dbi_mixed_can.off_diagonal_norm)\n", "print(\"By comparison, the Pauli-Z:\", off_diagonal_norm_history[2])" ] @@ -479,7 +443,7 @@ "remaining_NSTEPS = NSTEPS - cannonical_NSTEPS\n", "dbi_mixed_can.mode = DoubleBracketGeneratorType.single_commutator\n", "for _ in range(remaining_NSTEPS):\n", - " dbi_mixed_can, idx, step, flip_sign = select_best_dbr_generator(dbi_mixed_can, Z_ops, compare_canonical=False)\n", + " dbi_mixed_can, idx, step, flip_sign = select_best_dbr_generator(dbi_mixed_can, Z_ops, scheduling=scheduling, compare_canonical=False, max_evals=max_evals, step_max=step_max)\n", " off_diagonal_norm_history_mixed_can.append(dbi_mixed_can.off_diagonal_norm)\n", " steps_mixed_can.append(step)\n", " if idx == len(Z_ops):\n", @@ -516,27 +480,14 @@ "source": [ "This example also shows that the canonical generator is more likely to drive the model into a local minimum than variationally assigned diagonal operator, and that it is hard to get it unstuck even with the Pauli-Z operators." ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.7" - } - }, + "metadata": {}, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/examples/dbi/dbi_tutorial_basic_intro.ipynb b/examples/dbi/dbi_tutorial_basic_intro.ipynb index ecb28bb4d7..bcd0d65c67 100644 --- a/examples/dbi/dbi_tutorial_basic_intro.ipynb +++ b/examples/dbi/dbi_tutorial_basic_intro.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "cb748c1a-2ecd-44a2-91d8-c1255a00615b", + "id": "2a33581d", "metadata": {}, "source": [ "## Double-Bracket Iteration diagonalization algorithm\n", @@ -17,18 +17,18 @@ { "cell_type": "code", "execution_count": null, - "id": "e1f362b8-eb73-456e-ae48-94c5f2a12649", + "id": "62d9723f", "metadata": {}, "outputs": [], "source": [ - "!python -m pip install seaborn # plotting library\n", - "!python -m pip install hyperopt # required to optimize the DBF step" + "# uncomment this line if seaborn is not installed\n", + "# !python -m pip install seaborn" ] }, { "cell_type": "code", "execution_count": null, - "id": "f270b1ea-ee6a-4eac-a0ff-3d7dae296cf0", + "id": "b80b4738", "metadata": {}, "outputs": [], "source": [ @@ -41,12 +41,12 @@ "from hyperopt import hp, tpe\n", "\n", "from qibo import hamiltonians, set_backend\n", - "from qibo.models.dbi.double_bracket import DoubleBracketGeneratorType, DoubleBracketIteration" + "from qibo.models.dbi.double_bracket import DoubleBracketGeneratorType, DoubleBracketIteration, DoubleBracketScheduling" ] }, { "cell_type": "markdown", - "id": "ba6e5402-ea34-4979-bb79-fd395567f77d", + "id": "a5e25f51", "metadata": {}, "source": [ "Here we define a simple plotting function useful to keep track of the diagonalization process." @@ -55,7 +55,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4aec7b46-19b9-4004-93c0-a90255e58fd9", + "id": "933d9a00", "metadata": {}, "outputs": [], "source": [ @@ -96,7 +96,7 @@ }, { "cell_type": "markdown", - "id": "9f4cd7cc-9952-4da4-baef-e916300a9365", + "id": "4efd4a97", "metadata": {}, "source": [ "We need to define a target hamiltonian which we aim to diagonalize. As an example, we consider the Transverse Field Ising Model (TFIM):\n", @@ -107,12 +107,12 @@ { "cell_type": "code", "execution_count": null, - "id": "2c4ed408-68ed-4054-825c-2a7df0979a4f", + "id": "7125940f", "metadata": {}, "outputs": [], "source": [ "# set the qibo backend (we suggest qibojit if N >= 20)\n", - "set_backend(\"qibojit\", \"numba\")\n", + "set_backend(\"qibojit\", platform=\"numba\")\n", "\n", "# hamiltonian parameters\n", "nqubits = 5\n", @@ -127,7 +127,7 @@ }, { "cell_type": "markdown", - "id": "4794e779-bf2d-4ab5-97ce-f876d9522a35", + "id": "c2ca8392", "metadata": {}, "source": [ "#### The generator of the evolution\n", @@ -148,7 +148,7 @@ { "cell_type": "code", "execution_count": null, - "id": "26a487e9-366b-4203-b660-e3d4af2bcb68", + "id": "1adafc19", "metadata": {}, "outputs": [], "source": [ @@ -160,7 +160,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da8dce89-27f6-403d-982a-58d531fade48", + "id": "8a4d0e9d", "metadata": {}, "outputs": [], "source": [ @@ -170,7 +170,7 @@ }, { "cell_type": "markdown", - "id": "fc4f9f75-0548-4533-a13c-3aba3191e608", + "id": "a5527622", "metadata": {}, "source": [ "#### The `DoubleBracketIteration` class\n", @@ -181,7 +181,7 @@ { "cell_type": "code", "execution_count": null, - "id": "055870ec-55f2-4b99-a622-e3aa4c7dd0e9", + "id": "9521c464", "metadata": {}, "outputs": [], "source": [ @@ -190,7 +190,7 @@ }, { "cell_type": "markdown", - "id": "b38cf803-60b4-467a-be8e-cbad5d81f14a", + "id": "a262c69f", "metadata": {}, "source": [ "#### `DoubleBracketIteration` features" @@ -199,7 +199,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9e278c3d-9f34-4a40-b453-4e030c751ef5", + "id": "290e5828", "metadata": {}, "outputs": [], "source": [ @@ -210,7 +210,7 @@ { "cell_type": "code", "execution_count": null, - "id": "5b8e142b-a0a2-41bd-a16a-265a420b7360", + "id": "3e2b9950", "metadata": {}, "outputs": [], "source": [ @@ -222,7 +222,7 @@ { "cell_type": "code", "execution_count": null, - "id": "4f9d1d41-3df7-49cf-96ca-fa1019c00c33", + "id": "638ba4b5", "metadata": {}, "outputs": [], "source": [ @@ -233,7 +233,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7b864712-219c-44b6-8337-19ef0100e318", + "id": "08f0c466", "metadata": {}, "outputs": [], "source": [ @@ -243,7 +243,7 @@ }, { "cell_type": "markdown", - "id": "5e576bc4-4e79-4c71-9ea0-b3012e9f2ba1", + "id": "bb5f10da", "metadata": {}, "source": [ "which shows $\\hat{H}$ is now identical to $\\hat{H}_0$ since no evolution step has been performed yet." @@ -252,7 +252,7 @@ { "cell_type": "code", "execution_count": null, - "id": "da3d3aaa-17e1-492e-bcd3-b510f44a5391", + "id": "90e6fdff", "metadata": {}, "outputs": [], "source": [ @@ -262,7 +262,7 @@ }, { "cell_type": "markdown", - "id": "ca0ce252", + "id": "a0101ae0", "metadata": {}, "source": [ "The Hilbert-Schmidt norm of a Hamiltonian is defined as:\n", @@ -273,7 +273,7 @@ { "cell_type": "code", "execution_count": null, - "id": "24d0dfa1-7039-4d7d-8aa3-5a937b9ab0b8", + "id": "0d90c8b5", "metadata": {}, "outputs": [], "source": [ @@ -284,7 +284,7 @@ }, { "cell_type": "markdown", - "id": "d75e35ab-66f4-49f9-af19-679c20065a11", + "id": "a1d1eb77", "metadata": {}, "source": [ "Finally, the energy fluctuation of the system at step $k$ over a given state $\\mu$\n", @@ -297,7 +297,7 @@ { "cell_type": "code", "execution_count": null, - "id": "95f8d86f-07d4-498c-acb1-f6f6a4614c24", + "id": "13710cc2", "metadata": {}, "outputs": [], "source": [ @@ -312,7 +312,7 @@ }, { "cell_type": "markdown", - "id": "3d5b37f3-2477-49a0-9f80-7da5ddda1fff", + "id": "4d34e1e3", "metadata": {}, "source": [ "#### Call the `DoubleBracketIteration` to perform a DBF iteration\n", @@ -323,7 +323,7 @@ { "cell_type": "code", "execution_count": null, - "id": "9a886261-8aa6-4df0-a31b-9c39847db124", + "id": "a7749a96", "metadata": {}, "outputs": [], "source": [ @@ -340,7 +340,7 @@ }, { "cell_type": "markdown", - "id": "b78dd05d-ffe3-435a-b5ec-2a42f28066b2", + "id": "dab441bb", "metadata": {}, "source": [ "We can check now if something happened by plotting the drift:" @@ -349,7 +349,7 @@ { "cell_type": "code", "execution_count": null, - "id": "cc74812d-7c2c-44e4-afc2-e235968801b4", + "id": "fc01baa4", "metadata": {}, "outputs": [], "source": [ @@ -358,7 +358,7 @@ }, { "cell_type": "markdown", - "id": "3465a422-eebf-4e80-ae96-bba894132330", + "id": "9223433b", "metadata": {}, "source": [ "The set step can be good, but maybe not the best one. In order to do this choice in a wiser way, we can call the DBF hyperoptimization routine to search for a better initial step. The `dbf.hyperopt_step` method is built on top of the [`hyperopt`](https://hyperopt.github.io/hyperopt/) package. Any algorithm or sampling space provided by the official package can be used. We are going to use the default options (we sample new steps from a uniform space following a _Tree of Parzen estimators algorithm_)." @@ -367,7 +367,7 @@ { "cell_type": "code", "execution_count": null, - "id": "aad79966-7a11-4a45-aba5-4a4bb8315c50", + "id": "0d7b86d3", "metadata": {}, "outputs": [], "source": [ @@ -375,20 +375,20 @@ "dbf.h = dbf.h0\n", "\n", "# optimization of the step, we allow to search in [1e-5, 1]\n", - "step = dbf.hyperopt_step(\n", + "step = dbf.choose_step(\n", + " scheduling=DoubleBracketScheduling.hyperopt,\n", " step_min = 1e-5,\n", " step_max = 1,\n", " space = hp.uniform,\n", " optimizer = tpe,\n", " max_evals = 1000,\n", - " verbose = True\n", ")" ] }, { "cell_type": "code", "execution_count": null, - "id": "49483a47-d29d-440e-a4bc-143bfe6bb3cf", + "id": "1b9b1431", "metadata": {}, "outputs": [], "source": [ @@ -398,7 +398,7 @@ { "cell_type": "code", "execution_count": null, - "id": "6bdaf7f9-7e49-4a16-8b29-ae1f9746cd9b", + "id": "52fa3599", "metadata": {}, "outputs": [], "source": [ @@ -407,7 +407,7 @@ }, { "cell_type": "markdown", - "id": "b5f1d00e-e763-40d9-822f-e0e8d4c57d9a", + "id": "084c3bcb", "metadata": {}, "source": [ "#### Let's evolve the model for `NSTEPS`\n", @@ -420,7 +420,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59a6a485-a714-4e14-b27a-1df2930068ee", + "id": "d1f197b1", "metadata": {}, "outputs": [], "source": [ @@ -443,7 +443,7 @@ { "cell_type": "code", "execution_count": null, - "id": "7e0b2f18-ca53-4f34-9fcf-0052dcc31dc5", + "id": "c115c222", "metadata": {}, "outputs": [], "source": [ @@ -452,7 +452,7 @@ }, { "cell_type": "markdown", - "id": "eb797d6c-0eba-4da4-b492-8b5d70f9123f", + "id": "233ba431", "metadata": {}, "source": [ "#### Method 2: optimizing the step" @@ -461,30 +461,29 @@ { "cell_type": "code", "execution_count": null, - "id": "a6fd1e33-3620-4f3b-b705-a120f6da0027", + "id": "4e0fc1c2", "metadata": {}, "outputs": [], "source": [ "# restart\n", - "dbf_2 = DoubleBracketIteration(hamiltonian=deepcopy(h), mode=iterationtype)\n", + "dbf_2 = DoubleBracketIteration(hamiltonian=deepcopy(h), mode=iterationtype, scheduling=DoubleBracketScheduling.hyperopt)\n", "off_diagonal_norm_history = [dbf_2.off_diagonal_norm]\n", "\n", "# set the number of evolution steps\n", "NSTEPS = 20\n", "\n", "# optimize first step\n", - "step = dbf_2.hyperopt_step(\n", + "step = dbf_2.choose_step(\n", " step_min = 1e-5,\n", " step_max = 1,\n", " space = hp.uniform,\n", " optimizer = tpe,\n", " max_evals = 500,\n", - " verbose = True\n", ")\n", "\n", "for s in range(NSTEPS):\n", " if s != 0:\n", - " step = dbf_2.hyperopt_step(\n", + " step = dbf_2.choose_step(\n", " step_min = 1e-5,\n", " step_max = 1,\n", " space = hp.uniform,\n", @@ -502,7 +501,7 @@ { "cell_type": "code", "execution_count": null, - "id": "0f0212bf-b642-4fea-9203-037876e0b266", + "id": "40e31e97", "metadata": {}, "outputs": [], "source": [ @@ -511,7 +510,7 @@ }, { "cell_type": "markdown", - "id": "32341937-4178-41d2-a10e-5e4d2634098e", + "id": "0de78acd", "metadata": {}, "source": [ "The hyperoptimization can lead to a faster convergence of the algorithm." @@ -520,7 +519,7 @@ { "cell_type": "code", "execution_count": null, - "id": "82b89092-07e5-4788-9ae0-8907df2428eb", + "id": "baab0ab5", "metadata": {}, "outputs": [], "source": [ @@ -530,33 +529,23 @@ { "cell_type": "code", "execution_count": null, - "id": "ac8ed320-04a8-42af-a980-48ab4f1fff7c", + "id": "2bc9ac69", "metadata": {}, "outputs": [], "source": [ "visualize_matrix(dbf_2.h.matrix)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0bed191d", + "metadata": {}, + "outputs": [], + "source": [] } ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.11.7" - } - }, + "metadata": {}, "nbformat": 4, "nbformat_minor": 5 } diff --git a/poetry.lock b/poetry.lock index 8cbd28643a..1f9f6a070f 100644 --- a/poetry.lock +++ b/poetry.lock @@ -35,13 +35,13 @@ files = [ [[package]] name = "anyio" -version = "4.3.0" +version = "4.4.0" description = "High level compatibility layer for multiple asynchronous event loop implementations" optional = false python-versions = ">=3.8" files = [ - {file = "anyio-4.3.0-py3-none-any.whl", hash = "sha256:048e05d0f6caeed70d731f3db756d35dcc1f35747c8c403364a8332c630441b8"}, - {file = "anyio-4.3.0.tar.gz", hash = "sha256:f75253795a87df48568485fd18cdd2a3fa5c4f7c5be8e5e36637733fce06fed6"}, + {file = "anyio-4.4.0-py3-none-any.whl", hash = "sha256:c1b2d8f46a8a812513012e1107cb0e68c17159a7a594208005a57dc776e1bdc7"}, + {file = "anyio-4.4.0.tar.gz", hash = "sha256:5aadc6a1bbb7cdb0bede386cac5e2940f5e2ff3aa20277e991cf028e0585ce94"}, ] [package.dependencies] @@ -55,6 +55,17 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.23)"] +[[package]] +name = "appnope" +version = "0.1.4" +description = "Disable App Nap on macOS >= 10.9" +optional = false +python-versions = ">=3.6" +files = [ + {file = "appnope-0.1.4-py2.py3-none-any.whl", hash = "sha256:502575ee11cd7a28c0205f379b525beefebab9d161b7c964670864014ed7213c"}, + {file = "appnope-0.1.4.tar.gz", hash = "sha256:1de3860566df9caf38f01f86f65e0e13e379af54f9e4bee1e66b48f2efffd1ee"}, +] + [[package]] name = "astroid" version = "3.1.0" @@ -121,13 +132,13 @@ tests-no-zope = ["cloudpickle", "coverage[toml] (>=5.0.2)", "hypothesis", "mypy" [[package]] name = "autoray" -version = "0.6.9" +version = "0.6.12" description = "Abstract your array operations." optional = false python-versions = ">=3.8" files = [ - {file = "autoray-0.6.9-py3-none-any.whl", hash = "sha256:5685759f6e705f33cc3c614e57a55ba4822dc601969511465985159f2ea1573f"}, - {file = "autoray-0.6.9.tar.gz", hash = "sha256:9f41759f6a286bc280c4f6aece436da1c87ce75eb00efe7dc7319860c43654fa"}, + {file = "autoray-0.6.12-py3-none-any.whl", hash = "sha256:3ed7a4abcec052bcbb4f0447c426d0a0b9b9fa03ab71e76eaa77747ca43ac3e2"}, + {file = "autoray-0.6.12.tar.gz", hash = "sha256:721328aa06fc3577155d988052614a7b4bd6e4d01b340695344031ee4abd2a1e"}, ] [package.extras] @@ -136,13 +147,13 @@ tests = ["coverage", "numpy", "pytest", "pytest-cov"] [[package]] name = "babel" -version = "2.14.0" +version = "2.15.0" description = "Internationalization utilities" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "Babel-2.14.0-py3-none-any.whl", hash = "sha256:efb1a25b7118e67ce3a259bed20545c29cb68be8ad2c784c83689981b7a57287"}, - {file = "Babel-2.14.0.tar.gz", hash = "sha256:6919867db036398ba21eb5c7a0f6b28ab8cbc3ae7a73a44ebe34ae74a4e7d363"}, + {file = "Babel-2.15.0-py3-none-any.whl", hash = "sha256:08706bdad8d0a3413266ab61bd6c34d0c28d6e1e7badf40a2cebe67644e2e1fb"}, + {file = "babel-2.15.0.tar.gz", hash = "sha256:8daf0e265d05768bc6c7a314cf1321e9a123afc328cc635c18622a2f30a04413"}, ] [package.extras] @@ -200,13 +211,13 @@ files = [ [[package]] name = "certifi" -version = "2024.2.2" +version = "2024.6.2" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.6" files = [ - {file = "certifi-2024.2.2-py3-none-any.whl", hash = "sha256:dc383c07b76109f368f6106eee2b593b04a011ea4d55f652c6ca24a754d1cdd1"}, - {file = "certifi-2024.2.2.tar.gz", hash = "sha256:0569859f95fc761b18b45ef421b1290a0f65f147e92a1e5eb3e635f9a5e4e66f"}, + {file = "certifi-2024.6.2-py3-none-any.whl", hash = "sha256:ddc6c8ce995e6987e7faf5e3f1b02b302836a0e5d98ece18392cb1a36c72ad56"}, + {file = "certifi-2024.6.2.tar.gz", hash = "sha256:3cd43f1c6fa7dedc5899d69d3ad0398fd018ad1a17fba83ddaf78aa46c747516"}, ] [[package]] @@ -659,13 +670,13 @@ test-no-images = ["pytest", "pytest-cov", "pytest-xdist", "wurlitzer"] [[package]] name = "cotengra" -version = "0.6.0" +version = "0.6.2" description = "Hyper optimized contraction trees for large tensor networks and einsums." optional = false python-versions = ">=3.8" files = [ - {file = "cotengra-0.6.0-py3-none-any.whl", hash = "sha256:39b564cecc71b4b54b555854aacb06c32c74555dbcfb4c102634130709b043a0"}, - {file = "cotengra-0.6.0.tar.gz", hash = "sha256:dbd2d682d5eb40177246e8646dbabf0235650ca11f4986967b6ea9ee63549273"}, + {file = "cotengra-0.6.2-py3-none-any.whl", hash = "sha256:524711515cfbaae22ae56a8c6bf3339dfe50485b9b615de52f8f7c330847b196"}, + {file = "cotengra-0.6.2.tar.gz", hash = "sha256:a56b921d0339d1397e925a7b69029d3301636d09b99b509368751753bda39d24"}, ] [package.dependencies] @@ -673,68 +684,68 @@ autoray = "*" [package.extras] docs = ["astroid (<3.0.0)", "furo", "ipython (!=8.7.0)", "myst-nb", "setuptools-scm", "sphinx (>=2.0)", "sphinx-autoapi", "sphinx-copybutton", "sphinx-design"] -recommended = ["cotengrust", "cytoolz", "kahypar", "networkx", "numpy", "opt-einsum", "optuna", "ray", "tqdm"] +recommended = ["cotengrust (>=0.1.3)", "cytoolz", "kahypar", "networkx", "numpy", "opt-einsum", "optuna", "ray", "tqdm"] test = ["altair", "baytune", "chocolate", "dask", "distributed", "kahypar", "matplotlib", "networkx", "nevergrad", "numpy", "opt-einsum", "pytest", "seaborn", "skopt"] [[package]] name = "coverage" -version = "7.5.0" +version = "7.5.3" description = "Code coverage measurement for Python" optional = false python-versions = ">=3.8" files = [ - {file = "coverage-7.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:432949a32c3e3f820af808db1833d6d1631664d53dd3ce487aa25d574e18ad1c"}, - {file = "coverage-7.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:2bd7065249703cbeb6d4ce679c734bef0ee69baa7bff9724361ada04a15b7e3b"}, - {file = "coverage-7.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bbfe6389c5522b99768a93d89aca52ef92310a96b99782973b9d11e80511f932"}, - {file = "coverage-7.5.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:39793731182c4be939b4be0cdecde074b833f6171313cf53481f869937129ed3"}, - {file = "coverage-7.5.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:85a5dbe1ba1bf38d6c63b6d2c42132d45cbee6d9f0c51b52c59aa4afba057517"}, - {file = "coverage-7.5.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:357754dcdfd811462a725e7501a9b4556388e8ecf66e79df6f4b988fa3d0b39a"}, - {file = "coverage-7.5.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a81eb64feded34f40c8986869a2f764f0fe2db58c0530d3a4afbcde50f314880"}, - {file = "coverage-7.5.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:51431d0abbed3a868e967f8257c5faf283d41ec882f58413cf295a389bb22e58"}, - {file = "coverage-7.5.0-cp310-cp310-win32.whl", hash = "sha256:f609ebcb0242d84b7adeee2b06c11a2ddaec5464d21888b2c8255f5fd6a98ae4"}, - {file = "coverage-7.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:6782cd6216fab5a83216cc39f13ebe30adfac2fa72688c5a4d8d180cd52e8f6a"}, - {file = "coverage-7.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:e768d870801f68c74c2b669fc909839660180c366501d4cc4b87efd6b0eee375"}, - {file = "coverage-7.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:84921b10aeb2dd453247fd10de22907984eaf80901b578a5cf0bb1e279a587cb"}, - {file = "coverage-7.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:710c62b6e35a9a766b99b15cdc56d5aeda0914edae8bb467e9c355f75d14ee95"}, - {file = "coverage-7.5.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c379cdd3efc0658e652a14112d51a7668f6bfca7445c5a10dee7eabecabba19d"}, - {file = "coverage-7.5.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fea9d3ca80bcf17edb2c08a4704259dadac196fe5e9274067e7a20511fad1743"}, - {file = "coverage-7.5.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:41327143c5b1d715f5f98a397608f90ab9ebba606ae4e6f3389c2145410c52b1"}, - {file = "coverage-7.5.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:565b2e82d0968c977e0b0f7cbf25fd06d78d4856289abc79694c8edcce6eb2de"}, - {file = "coverage-7.5.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:cf3539007202ebfe03923128fedfdd245db5860a36810136ad95a564a2fdffff"}, - {file = "coverage-7.5.0-cp311-cp311-win32.whl", hash = "sha256:bf0b4b8d9caa8d64df838e0f8dcf68fb570c5733b726d1494b87f3da85db3a2d"}, - {file = "coverage-7.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:9c6384cc90e37cfb60435bbbe0488444e54b98700f727f16f64d8bfda0b84656"}, - {file = "coverage-7.5.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fed7a72d54bd52f4aeb6c6e951f363903bd7d70bc1cad64dd1f087980d309ab9"}, - {file = "coverage-7.5.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:cbe6581fcff7c8e262eb574244f81f5faaea539e712a058e6707a9d272fe5b64"}, - {file = "coverage-7.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ad97ec0da94b378e593ef532b980c15e377df9b9608c7c6da3506953182398af"}, - {file = "coverage-7.5.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bd4bacd62aa2f1a1627352fe68885d6ee694bdaebb16038b6e680f2924a9b2cc"}, - {file = "coverage-7.5.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:adf032b6c105881f9d77fa17d9eebe0ad1f9bfb2ad25777811f97c5362aa07f2"}, - {file = "coverage-7.5.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:4ba01d9ba112b55bfa4b24808ec431197bb34f09f66f7cb4fd0258ff9d3711b1"}, - {file = "coverage-7.5.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:f0bfe42523893c188e9616d853c47685e1c575fe25f737adf473d0405dcfa7eb"}, - {file = "coverage-7.5.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a9a7ef30a1b02547c1b23fa9a5564f03c9982fc71eb2ecb7f98c96d7a0db5cf2"}, - {file = "coverage-7.5.0-cp312-cp312-win32.whl", hash = "sha256:3c2b77f295edb9fcdb6a250f83e6481c679335ca7e6e4a955e4290350f2d22a4"}, - {file = "coverage-7.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:427e1e627b0963ac02d7c8730ca6d935df10280d230508c0ba059505e9233475"}, - {file = "coverage-7.5.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:9dd88fce54abbdbf4c42fb1fea0e498973d07816f24c0e27a1ecaf91883ce69e"}, - {file = "coverage-7.5.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a898c11dca8f8c97b467138004a30133974aacd572818c383596f8d5b2eb04a9"}, - {file = "coverage-7.5.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:07dfdd492d645eea1bd70fb1d6febdcf47db178b0d99161d8e4eed18e7f62fe7"}, - {file = "coverage-7.5.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d3d117890b6eee85887b1eed41eefe2e598ad6e40523d9f94c4c4b213258e4a4"}, - {file = "coverage-7.5.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6afd2e84e7da40fe23ca588379f815fb6dbbb1b757c883935ed11647205111cb"}, - {file = "coverage-7.5.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:a9960dd1891b2ddf13a7fe45339cd59ecee3abb6b8326d8b932d0c5da208104f"}, - {file = "coverage-7.5.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:ced268e82af993d7801a9db2dbc1d2322e786c5dc76295d8e89473d46c6b84d4"}, - {file = "coverage-7.5.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:e7c211f25777746d468d76f11719e64acb40eed410d81c26cefac641975beb88"}, - {file = "coverage-7.5.0-cp38-cp38-win32.whl", hash = "sha256:262fffc1f6c1a26125d5d573e1ec379285a3723363f3bd9c83923c9593a2ac25"}, - {file = "coverage-7.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:eed462b4541c540d63ab57b3fc69e7d8c84d5957668854ee4e408b50e92ce26a"}, - {file = "coverage-7.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d0194d654e360b3e6cc9b774e83235bae6b9b2cac3be09040880bb0e8a88f4a1"}, - {file = "coverage-7.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:33c020d3322662e74bc507fb11488773a96894aa82a622c35a5a28673c0c26f5"}, - {file = "coverage-7.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0cbdf2cae14a06827bec50bd58e49249452d211d9caddd8bd80e35b53cb04631"}, - {file = "coverage-7.5.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3235d7c781232e525b0761730e052388a01548bd7f67d0067a253887c6e8df46"}, - {file = "coverage-7.5.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2de4e546f0ec4b2787d625e0b16b78e99c3e21bc1722b4977c0dddf11ca84e"}, - {file = "coverage-7.5.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:4d0e206259b73af35c4ec1319fd04003776e11e859936658cb6ceffdeba0f5be"}, - {file = "coverage-7.5.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:2055c4fb9a6ff624253d432aa471a37202cd8f458c033d6d989be4499aed037b"}, - {file = "coverage-7.5.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:075299460948cd12722a970c7eae43d25d37989da682997687b34ae6b87c0ef0"}, - {file = "coverage-7.5.0-cp39-cp39-win32.whl", hash = "sha256:280132aada3bc2f0fac939a5771db4fbb84f245cb35b94fae4994d4c1f80dae7"}, - {file = "coverage-7.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:c58536f6892559e030e6924896a44098bc1290663ea12532c78cef71d0df8493"}, - {file = "coverage-7.5.0-pp38.pp39.pp310-none-any.whl", hash = "sha256:2b57780b51084d5223eee7b59f0d4911c31c16ee5aa12737c7a02455829ff067"}, - {file = "coverage-7.5.0.tar.gz", hash = "sha256:cf62d17310f34084c59c01e027259076479128d11e4661bb6c9acb38c5e19bb8"}, + {file = "coverage-7.5.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a6519d917abb15e12380406d721e37613e2a67d166f9fb7e5a8ce0375744cd45"}, + {file = "coverage-7.5.3-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:aea7da970f1feccf48be7335f8b2ca64baf9b589d79e05b9397a06696ce1a1ec"}, + {file = "coverage-7.5.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:923b7b1c717bd0f0f92d862d1ff51d9b2b55dbbd133e05680204465f454bb286"}, + {file = "coverage-7.5.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:62bda40da1e68898186f274f832ef3e759ce929da9a9fd9fcf265956de269dbc"}, + {file = "coverage-7.5.3-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8b7339180d00de83e930358223c617cc343dd08e1aa5ec7b06c3a121aec4e1d"}, + {file = "coverage-7.5.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:25a5caf742c6195e08002d3b6c2dd6947e50efc5fc2c2205f61ecb47592d2d83"}, + {file = "coverage-7.5.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:05ac5f60faa0c704c0f7e6a5cbfd6f02101ed05e0aee4d2822637a9e672c998d"}, + {file = "coverage-7.5.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:239a4e75e09c2b12ea478d28815acf83334d32e722e7433471fbf641c606344c"}, + {file = "coverage-7.5.3-cp310-cp310-win32.whl", hash = "sha256:a5812840d1d00eafae6585aba38021f90a705a25b8216ec7f66aebe5b619fb84"}, + {file = "coverage-7.5.3-cp310-cp310-win_amd64.whl", hash = "sha256:33ca90a0eb29225f195e30684ba4a6db05dbef03c2ccd50b9077714c48153cac"}, + {file = "coverage-7.5.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f81bc26d609bf0fbc622c7122ba6307993c83c795d2d6f6f6fd8c000a770d974"}, + {file = "coverage-7.5.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7cec2af81f9e7569280822be68bd57e51b86d42e59ea30d10ebdbb22d2cb7232"}, + {file = "coverage-7.5.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55f689f846661e3f26efa535071775d0483388a1ccfab899df72924805e9e7cd"}, + {file = "coverage-7.5.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:50084d3516aa263791198913a17354bd1dc627d3c1639209640b9cac3fef5807"}, + {file = "coverage-7.5.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:341dd8f61c26337c37988345ca5c8ccabeff33093a26953a1ac72e7d0103c4fb"}, + {file = "coverage-7.5.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ab0b028165eea880af12f66086694768f2c3139b2c31ad5e032c8edbafca6ffc"}, + {file = "coverage-7.5.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5bc5a8c87714b0c67cfeb4c7caa82b2d71e8864d1a46aa990b5588fa953673b8"}, + {file = "coverage-7.5.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:38a3b98dae8a7c9057bd91fbf3415c05e700a5114c5f1b5b0ea5f8f429ba6614"}, + {file = "coverage-7.5.3-cp311-cp311-win32.whl", hash = "sha256:fcf7d1d6f5da887ca04302db8e0e0cf56ce9a5e05f202720e49b3e8157ddb9a9"}, + {file = "coverage-7.5.3-cp311-cp311-win_amd64.whl", hash = "sha256:8c836309931839cca658a78a888dab9676b5c988d0dd34ca247f5f3e679f4e7a"}, + {file = "coverage-7.5.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:296a7d9bbc598e8744c00f7a6cecf1da9b30ae9ad51c566291ff1314e6cbbed8"}, + {file = "coverage-7.5.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:34d6d21d8795a97b14d503dcaf74226ae51eb1f2bd41015d3ef332a24d0a17b3"}, + {file = "coverage-7.5.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e317953bb4c074c06c798a11dbdd2cf9979dbcaa8ccc0fa4701d80042d4ebf1"}, + {file = "coverage-7.5.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:705f3d7c2b098c40f5b81790a5fedb274113373d4d1a69e65f8b68b0cc26f6db"}, + {file = "coverage-7.5.3-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b1196e13c45e327d6cd0b6e471530a1882f1017eb83c6229fc613cd1a11b53cd"}, + {file = "coverage-7.5.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:015eddc5ccd5364dcb902eaecf9515636806fa1e0d5bef5769d06d0f31b54523"}, + {file = "coverage-7.5.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:fd27d8b49e574e50caa65196d908f80e4dff64d7e592d0c59788b45aad7e8b35"}, + {file = "coverage-7.5.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:33fc65740267222fc02975c061eb7167185fef4cc8f2770267ee8bf7d6a42f84"}, + {file = "coverage-7.5.3-cp312-cp312-win32.whl", hash = "sha256:7b2a19e13dfb5c8e145c7a6ea959485ee8e2204699903c88c7d25283584bfc08"}, + {file = "coverage-7.5.3-cp312-cp312-win_amd64.whl", hash = "sha256:0bbddc54bbacfc09b3edaec644d4ac90c08ee8ed4844b0f86227dcda2d428fcb"}, + {file = "coverage-7.5.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f78300789a708ac1f17e134593f577407d52d0417305435b134805c4fb135adb"}, + {file = "coverage-7.5.3-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:b368e1aee1b9b75757942d44d7598dcd22a9dbb126affcbba82d15917f0cc155"}, + {file = "coverage-7.5.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f836c174c3a7f639bded48ec913f348c4761cbf49de4a20a956d3431a7c9cb24"}, + {file = "coverage-7.5.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:244f509f126dc71369393ce5fea17c0592c40ee44e607b6d855e9c4ac57aac98"}, + {file = "coverage-7.5.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c4c2872b3c91f9baa836147ca33650dc5c172e9273c808c3c3199c75490e709d"}, + {file = "coverage-7.5.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:dd4b3355b01273a56b20c219e74e7549e14370b31a4ffe42706a8cda91f19f6d"}, + {file = "coverage-7.5.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:f542287b1489c7a860d43a7d8883e27ca62ab84ca53c965d11dac1d3a1fab7ce"}, + {file = "coverage-7.5.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:75e3f4e86804023e991096b29e147e635f5e2568f77883a1e6eed74512659ab0"}, + {file = "coverage-7.5.3-cp38-cp38-win32.whl", hash = "sha256:c59d2ad092dc0551d9f79d9d44d005c945ba95832a6798f98f9216ede3d5f485"}, + {file = "coverage-7.5.3-cp38-cp38-win_amd64.whl", hash = "sha256:fa21a04112c59ad54f69d80e376f7f9d0f5f9123ab87ecd18fbb9ec3a2beed56"}, + {file = "coverage-7.5.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f5102a92855d518b0996eb197772f5ac2a527c0ec617124ad5242a3af5e25f85"}, + {file = "coverage-7.5.3-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:d1da0a2e3b37b745a2b2a678a4c796462cf753aebf94edcc87dcc6b8641eae31"}, + {file = "coverage-7.5.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8383a6c8cefba1b7cecc0149415046b6fc38836295bc4c84e820872eb5478b3d"}, + {file = "coverage-7.5.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9aad68c3f2566dfae84bf46295a79e79d904e1c21ccfc66de88cd446f8686341"}, + {file = "coverage-7.5.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2e079c9ec772fedbade9d7ebc36202a1d9ef7291bc9b3a024ca395c4d52853d7"}, + {file = "coverage-7.5.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:bde997cac85fcac227b27d4fb2c7608a2c5f6558469b0eb704c5726ae49e1c52"}, + {file = "coverage-7.5.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:990fb20b32990b2ce2c5f974c3e738c9358b2735bc05075d50a6f36721b8f303"}, + {file = "coverage-7.5.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:3d5a67f0da401e105753d474369ab034c7bae51a4c31c77d94030d59e41df5bd"}, + {file = "coverage-7.5.3-cp39-cp39-win32.whl", hash = "sha256:e08c470c2eb01977d221fd87495b44867a56d4d594f43739a8028f8646a51e0d"}, + {file = "coverage-7.5.3-cp39-cp39-win_amd64.whl", hash = "sha256:1d2a830ade66d3563bb61d1e3c77c8def97b30ed91e166c67d0632c018f380f0"}, + {file = "coverage-7.5.3-pp38.pp39.pp310-none-any.whl", hash = "sha256:3538d8fb1ee9bdd2e2692b3b18c22bb1c19ffbefd06880f5ac496e42d7bb3884"}, + {file = "coverage-7.5.3.tar.gz", hash = "sha256:04aefca5190d1dc7a53a4c1a5a7f8568811306d7a8ee231c42fb69215571944f"}, ] [package.dependencies] @@ -852,24 +863,24 @@ numpy = ">=1.21,<2.0" [[package]] name = "custatevec-cu11" -version = "1.6.0" +version = "1.6.0.post1" description = "cuStateVec - a component of NVIDIA cuQuantum SDK" optional = false python-versions = "*" files = [ - {file = "custatevec_cu11-1.6.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:1b86051c365705fcc3ac33eff846385641a3f98d2c2cdbcecd7caab7e3bf0913"}, - {file = "custatevec_cu11-1.6.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:5c932d03d1792cf432ecd972e641dfeb4318be00c3934a44c765938e7d9bb404"}, + {file = "custatevec_cu11-1.6.0.post1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:6840bd957455d33f9df1f2e266fe33079e429b2442f5ff6ef5eae6c1b618108e"}, + {file = "custatevec_cu11-1.6.0.post1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:8d57ada4d3cc77b24b3be83b55929942186698e71edadaa952448c1b0af43539"}, ] [[package]] name = "custatevec-cu12" -version = "1.6.0" +version = "1.6.0.post1" description = "cuStateVec - a component of NVIDIA cuQuantum SDK" optional = false python-versions = "*" files = [ - {file = "custatevec_cu12-1.6.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:e9296be9eec8b4c32407424a6a7fc6e386c38eefbb649beb73f5a517c6dd3704"}, - {file = "custatevec_cu12-1.6.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:4d3505eff236f822adba4d313358b659fe145824b5be2c7283c1d6243b05be00"}, + {file = "custatevec_cu12-1.6.0.post1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:4f38175cb6cb9dfa0008e5109e22bf92eeedd3aad843be3ce27ad41b53318f95"}, + {file = "custatevec_cu12-1.6.0.post1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:0c875981de852091f5f3c040d705b284424171aa5df07f843728ff2fae450016"}, ] [[package]] @@ -898,13 +909,13 @@ files = [ [[package]] name = "cutensornet-cu11" -version = "2.4.0" +version = "2.4.0.post1" description = "cuTensorNet - a component of NVIDIA cuQuantum SDK" optional = false python-versions = "*" files = [ - {file = "cutensornet_cu11-2.4.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:c3c9e2018dbdc29391d29c9b04897126076359ca5957bde447de72478cc98e26"}, - {file = "cutensornet_cu11-2.4.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:712f3d9784c3830138e8eef2f3a1b66375f4742e90c943b92aa944129478108a"}, + {file = "cutensornet_cu11-2.4.0.post1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:110b64a69f245666f5895ae621c9205d5aabb008e3e845f716620d3fd3846633"}, + {file = "cutensornet_cu11-2.4.0.post1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:8a4ef6517086623c702138a8f5f0e8c69a9e71ba6e729b05889778058449ba42"}, ] [package.dependencies] @@ -912,13 +923,13 @@ cutensor-cu11 = ">=2.0.1,<3" [[package]] name = "cutensornet-cu12" -version = "2.4.0" +version = "2.4.0.post1" description = "cuTensorNet - a component of NVIDIA cuQuantum SDK" optional = false python-versions = "*" files = [ - {file = "cutensornet_cu12-2.4.0-py3-none-manylinux2014_aarch64.whl", hash = "sha256:1c64b4802c57a727c12129142419cbfcf4db8f2534738f1c99106f3c7a346882"}, - {file = "cutensornet_cu12-2.4.0-py3-none-manylinux2014_x86_64.whl", hash = "sha256:af08991e732b6f8672b72fef175e3be8d9609403cbc3871c172c61a3d437a4bb"}, + {file = "cutensornet_cu12-2.4.0.post1-py3-none-manylinux2014_aarch64.whl", hash = "sha256:0356564387165914ea3c07047a1ffef2d92dac74a97b544e63664c6cef0af599"}, + {file = "cutensornet_cu12-2.4.0.post1-py3-none-manylinux2014_x86_64.whl", hash = "sha256:2301e1f6e24fd002b69a89358592898a949a319ba6497bd3d5ff569ec5841d45"}, ] [package.dependencies] @@ -1058,6 +1069,37 @@ toolz = ">=0.8.0" [package.extras] cython = ["cython"] +[[package]] +name = "debugpy" +version = "1.8.1" +description = "An implementation of the Debug Adapter Protocol for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "debugpy-1.8.1-cp310-cp310-macosx_11_0_x86_64.whl", hash = "sha256:3bda0f1e943d386cc7a0e71bfa59f4137909e2ed947fb3946c506e113000f741"}, + {file = "debugpy-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dda73bf69ea479c8577a0448f8c707691152e6c4de7f0c4dec5a4bc11dee516e"}, + {file = "debugpy-1.8.1-cp310-cp310-win32.whl", hash = "sha256:3a79c6f62adef994b2dbe9fc2cc9cc3864a23575b6e387339ab739873bea53d0"}, + {file = "debugpy-1.8.1-cp310-cp310-win_amd64.whl", hash = "sha256:7eb7bd2b56ea3bedb009616d9e2f64aab8fc7000d481faec3cd26c98a964bcdd"}, + {file = "debugpy-1.8.1-cp311-cp311-macosx_11_0_universal2.whl", hash = "sha256:016a9fcfc2c6b57f939673c874310d8581d51a0fe0858e7fac4e240c5eb743cb"}, + {file = "debugpy-1.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd97ed11a4c7f6d042d320ce03d83b20c3fb40da892f994bc041bbc415d7a099"}, + {file = "debugpy-1.8.1-cp311-cp311-win32.whl", hash = "sha256:0de56aba8249c28a300bdb0672a9b94785074eb82eb672db66c8144fff673146"}, + {file = "debugpy-1.8.1-cp311-cp311-win_amd64.whl", hash = "sha256:1a9fe0829c2b854757b4fd0a338d93bc17249a3bf69ecf765c61d4c522bb92a8"}, + {file = "debugpy-1.8.1-cp312-cp312-macosx_11_0_universal2.whl", hash = "sha256:3ebb70ba1a6524d19fa7bb122f44b74170c447d5746a503e36adc244a20ac539"}, + {file = "debugpy-1.8.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a2e658a9630f27534e63922ebf655a6ab60c370f4d2fc5c02a5b19baf4410ace"}, + {file = "debugpy-1.8.1-cp312-cp312-win32.whl", hash = "sha256:caad2846e21188797a1f17fc09c31b84c7c3c23baf2516fed5b40b378515bbf0"}, + {file = "debugpy-1.8.1-cp312-cp312-win_amd64.whl", hash = "sha256:edcc9f58ec0fd121a25bc950d4578df47428d72e1a0d66c07403b04eb93bcf98"}, + {file = "debugpy-1.8.1-cp38-cp38-macosx_11_0_x86_64.whl", hash = "sha256:7a3afa222f6fd3d9dfecd52729bc2e12c93e22a7491405a0ecbf9e1d32d45b39"}, + {file = "debugpy-1.8.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d915a18f0597ef685e88bb35e5d7ab968964b7befefe1aaea1eb5b2640b586c7"}, + {file = "debugpy-1.8.1-cp38-cp38-win32.whl", hash = "sha256:92116039b5500633cc8d44ecc187abe2dfa9b90f7a82bbf81d079fcdd506bae9"}, + {file = "debugpy-1.8.1-cp38-cp38-win_amd64.whl", hash = "sha256:e38beb7992b5afd9d5244e96ad5fa9135e94993b0c551ceebf3fe1a5d9beb234"}, + {file = "debugpy-1.8.1-cp39-cp39-macosx_11_0_x86_64.whl", hash = "sha256:bfb20cb57486c8e4793d41996652e5a6a885b4d9175dd369045dad59eaacea42"}, + {file = "debugpy-1.8.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:efd3fdd3f67a7e576dd869c184c5dd71d9aaa36ded271939da352880c012e703"}, + {file = "debugpy-1.8.1-cp39-cp39-win32.whl", hash = "sha256:58911e8521ca0c785ac7a0539f1e77e0ce2df753f786188f382229278b4cdf23"}, + {file = "debugpy-1.8.1-cp39-cp39-win_amd64.whl", hash = "sha256:6df9aa9599eb05ca179fb0b810282255202a66835c6efb1d112d21ecb830ddd3"}, + {file = "debugpy-1.8.1-py2.py3-none-any.whl", hash = "sha256:28acbe2241222b87e255260c76741e1fbf04fdc3b6d094fcf57b6c6f75ce1242"}, + {file = "debugpy-1.8.1.zip", hash = "sha256:f696d6be15be87aef621917585f9bb94b1dc9e8aced570db1b8a6fc14e8f9b42"}, +] + [[package]] name = "decorator" version = "5.1.1" @@ -1307,53 +1349,53 @@ files = [ [[package]] name = "fonttools" -version = "4.51.0" +version = "4.53.0" description = "Tools to manipulate font files" optional = false python-versions = ">=3.8" files = [ - {file = "fonttools-4.51.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:84d7751f4468dd8cdd03ddada18b8b0857a5beec80bce9f435742abc9a851a74"}, - {file = "fonttools-4.51.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8b4850fa2ef2cfbc1d1f689bc159ef0f45d8d83298c1425838095bf53ef46308"}, - {file = "fonttools-4.51.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b5b48a1121117047d82695d276c2af2ee3a24ffe0f502ed581acc2673ecf1037"}, - {file = "fonttools-4.51.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:180194c7fe60c989bb627d7ed5011f2bef1c4d36ecf3ec64daec8302f1ae0716"}, - {file = "fonttools-4.51.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:96a48e137c36be55e68845fc4284533bda2980f8d6f835e26bca79d7e2006438"}, - {file = "fonttools-4.51.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:806e7912c32a657fa39d2d6eb1d3012d35f841387c8fc6cf349ed70b7c340039"}, - {file = "fonttools-4.51.0-cp310-cp310-win32.whl", hash = "sha256:32b17504696f605e9e960647c5f64b35704782a502cc26a37b800b4d69ff3c77"}, - {file = "fonttools-4.51.0-cp310-cp310-win_amd64.whl", hash = "sha256:c7e91abdfae1b5c9e3a543f48ce96013f9a08c6c9668f1e6be0beabf0a569c1b"}, - {file = "fonttools-4.51.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a8feca65bab31479d795b0d16c9a9852902e3a3c0630678efb0b2b7941ea9c74"}, - {file = "fonttools-4.51.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8ac27f436e8af7779f0bb4d5425aa3535270494d3bc5459ed27de3f03151e4c2"}, - {file = "fonttools-4.51.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0e19bd9e9964a09cd2433a4b100ca7f34e34731e0758e13ba9a1ed6e5468cc0f"}, - {file = "fonttools-4.51.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b2b92381f37b39ba2fc98c3a45a9d6383bfc9916a87d66ccb6553f7bdd129097"}, - {file = "fonttools-4.51.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:5f6bc991d1610f5c3bbe997b0233cbc234b8e82fa99fc0b2932dc1ca5e5afec0"}, - {file = "fonttools-4.51.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:9696fe9f3f0c32e9a321d5268208a7cc9205a52f99b89479d1b035ed54c923f1"}, - {file = "fonttools-4.51.0-cp311-cp311-win32.whl", hash = "sha256:3bee3f3bd9fa1d5ee616ccfd13b27ca605c2b4270e45715bd2883e9504735034"}, - {file = "fonttools-4.51.0-cp311-cp311-win_amd64.whl", hash = "sha256:0f08c901d3866a8905363619e3741c33f0a83a680d92a9f0e575985c2634fcc1"}, - {file = "fonttools-4.51.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:4060acc2bfa2d8e98117828a238889f13b6f69d59f4f2d5857eece5277b829ba"}, - {file = "fonttools-4.51.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:1250e818b5f8a679ad79660855528120a8f0288f8f30ec88b83db51515411fcc"}, - {file = "fonttools-4.51.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76f1777d8b3386479ffb4a282e74318e730014d86ce60f016908d9801af9ca2a"}, - {file = "fonttools-4.51.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8b5ad456813d93b9c4b7ee55302208db2b45324315129d85275c01f5cb7e61a2"}, - {file = "fonttools-4.51.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:68b3fb7775a923be73e739f92f7e8a72725fd333eab24834041365d2278c3671"}, - {file = "fonttools-4.51.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8e2f1a4499e3b5ee82c19b5ee57f0294673125c65b0a1ff3764ea1f9db2f9ef5"}, - {file = "fonttools-4.51.0-cp312-cp312-win32.whl", hash = "sha256:278e50f6b003c6aed19bae2242b364e575bcb16304b53f2b64f6551b9c000e15"}, - {file = "fonttools-4.51.0-cp312-cp312-win_amd64.whl", hash = "sha256:b3c61423f22165541b9403ee39874dcae84cd57a9078b82e1dce8cb06b07fa2e"}, - {file = "fonttools-4.51.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:1621ee57da887c17312acc4b0e7ac30d3a4fb0fec6174b2e3754a74c26bbed1e"}, - {file = "fonttools-4.51.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e9d9298be7a05bb4801f558522adbe2feea1b0b103d5294ebf24a92dd49b78e5"}, - {file = "fonttools-4.51.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ee1af4be1c5afe4c96ca23badd368d8dc75f611887fb0c0dac9f71ee5d6f110e"}, - {file = "fonttools-4.51.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c18b49adc721a7d0b8dfe7c3130c89b8704baf599fb396396d07d4aa69b824a1"}, - {file = "fonttools-4.51.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:de7c29bdbdd35811f14493ffd2534b88f0ce1b9065316433b22d63ca1cd21f14"}, - {file = "fonttools-4.51.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:cadf4e12a608ef1d13e039864f484c8a968840afa0258b0b843a0556497ea9ed"}, - {file = "fonttools-4.51.0-cp38-cp38-win32.whl", hash = "sha256:aefa011207ed36cd280babfaa8510b8176f1a77261833e895a9d96e57e44802f"}, - {file = "fonttools-4.51.0-cp38-cp38-win_amd64.whl", hash = "sha256:865a58b6e60b0938874af0968cd0553bcd88e0b2cb6e588727117bd099eef836"}, - {file = "fonttools-4.51.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:60a3409c9112aec02d5fb546f557bca6efa773dcb32ac147c6baf5f742e6258b"}, - {file = "fonttools-4.51.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f7e89853d8bea103c8e3514b9f9dc86b5b4120afb4583b57eb10dfa5afbe0936"}, - {file = "fonttools-4.51.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:56fc244f2585d6c00b9bcc59e6593e646cf095a96fe68d62cd4da53dd1287b55"}, - {file = "fonttools-4.51.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0d145976194a5242fdd22df18a1b451481a88071feadf251221af110ca8f00ce"}, - {file = "fonttools-4.51.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c5b8cab0c137ca229433570151b5c1fc6af212680b58b15abd797dcdd9dd5051"}, - {file = "fonttools-4.51.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:54dcf21a2f2d06ded676e3c3f9f74b2bafded3a8ff12f0983160b13e9f2fb4a7"}, - {file = "fonttools-4.51.0-cp39-cp39-win32.whl", hash = "sha256:0118ef998a0699a96c7b28457f15546815015a2710a1b23a7bf6c1be60c01636"}, - {file = "fonttools-4.51.0-cp39-cp39-win_amd64.whl", hash = "sha256:599bdb75e220241cedc6faebfafedd7670335d2e29620d207dd0378a4e9ccc5a"}, - {file = "fonttools-4.51.0-py3-none-any.whl", hash = "sha256:15c94eeef6b095831067f72c825eb0e2d48bb4cea0647c1b05c981ecba2bf39f"}, - {file = "fonttools-4.51.0.tar.gz", hash = "sha256:dc0673361331566d7a663d7ce0f6fdcbfbdc1f59c6e3ed1165ad7202ca183c68"}, + {file = "fonttools-4.53.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:52a6e0a7a0bf611c19bc8ec8f7592bdae79c8296c70eb05917fd831354699b20"}, + {file = "fonttools-4.53.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:099634631b9dd271d4a835d2b2a9e042ccc94ecdf7e2dd9f7f34f7daf333358d"}, + {file = "fonttools-4.53.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e40013572bfb843d6794a3ce076c29ef4efd15937ab833f520117f8eccc84fd6"}, + {file = "fonttools-4.53.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:715b41c3e231f7334cbe79dfc698213dcb7211520ec7a3bc2ba20c8515e8a3b5"}, + {file = "fonttools-4.53.0-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:74ae2441731a05b44d5988d3ac2cf784d3ee0a535dbed257cbfff4be8bb49eb9"}, + {file = "fonttools-4.53.0-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:95db0c6581a54b47c30860d013977b8a14febc206c8b5ff562f9fe32738a8aca"}, + {file = "fonttools-4.53.0-cp310-cp310-win32.whl", hash = "sha256:9cd7a6beec6495d1dffb1033d50a3f82dfece23e9eb3c20cd3c2444d27514068"}, + {file = "fonttools-4.53.0-cp310-cp310-win_amd64.whl", hash = "sha256:daaef7390e632283051e3cf3e16aff2b68b247e99aea916f64e578c0449c9c68"}, + {file = "fonttools-4.53.0-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a209d2e624ba492df4f3bfad5996d1f76f03069c6133c60cd04f9a9e715595ec"}, + {file = "fonttools-4.53.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:4f520d9ac5b938e6494f58a25c77564beca7d0199ecf726e1bd3d56872c59749"}, + {file = "fonttools-4.53.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eceef49f457253000e6a2d0f7bd08ff4e9fe96ec4ffce2dbcb32e34d9c1b8161"}, + {file = "fonttools-4.53.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa1f3e34373aa16045484b4d9d352d4c6b5f9f77ac77a178252ccbc851e8b2ee"}, + {file = "fonttools-4.53.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:28d072169fe8275fb1a0d35e3233f6df36a7e8474e56cb790a7258ad822b6fd6"}, + {file = "fonttools-4.53.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:4a2a6ba400d386e904fd05db81f73bee0008af37799a7586deaa4aef8cd5971e"}, + {file = "fonttools-4.53.0-cp311-cp311-win32.whl", hash = "sha256:bb7273789f69b565d88e97e9e1da602b4ee7ba733caf35a6c2affd4334d4f005"}, + {file = "fonttools-4.53.0-cp311-cp311-win_amd64.whl", hash = "sha256:9fe9096a60113e1d755e9e6bda15ef7e03391ee0554d22829aa506cdf946f796"}, + {file = "fonttools-4.53.0-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:d8f191a17369bd53a5557a5ee4bab91d5330ca3aefcdf17fab9a497b0e7cff7a"}, + {file = "fonttools-4.53.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:93156dd7f90ae0a1b0e8871032a07ef3178f553f0c70c386025a808f3a63b1f4"}, + {file = "fonttools-4.53.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bff98816cb144fb7b85e4b5ba3888a33b56ecef075b0e95b95bcd0a5fbf20f06"}, + {file = "fonttools-4.53.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:973d030180eca8255b1bce6ffc09ef38a05dcec0e8320cc9b7bcaa65346f341d"}, + {file = "fonttools-4.53.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c4ee5a24e281fbd8261c6ab29faa7fd9a87a12e8c0eed485b705236c65999109"}, + {file = "fonttools-4.53.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:bd5bc124fae781a4422f61b98d1d7faa47985f663a64770b78f13d2c072410c2"}, + {file = "fonttools-4.53.0-cp312-cp312-win32.whl", hash = "sha256:a239afa1126b6a619130909c8404070e2b473dd2b7fc4aacacd2e763f8597fea"}, + {file = "fonttools-4.53.0-cp312-cp312-win_amd64.whl", hash = "sha256:45b4afb069039f0366a43a5d454bc54eea942bfb66b3fc3e9a2c07ef4d617380"}, + {file = "fonttools-4.53.0-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:93bc9e5aaa06ff928d751dc6be889ff3e7d2aa393ab873bc7f6396a99f6fbb12"}, + {file = "fonttools-4.53.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2367d47816cc9783a28645bc1dac07f8ffc93e0f015e8c9fc674a5b76a6da6e4"}, + {file = "fonttools-4.53.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:907fa0b662dd8fc1d7c661b90782ce81afb510fc4b7aa6ae7304d6c094b27bce"}, + {file = "fonttools-4.53.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3e0ad3c6ea4bd6a289d958a1eb922767233f00982cf0fe42b177657c86c80a8f"}, + {file = "fonttools-4.53.0-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:73121a9b7ff93ada888aaee3985a88495489cc027894458cb1a736660bdfb206"}, + {file = "fonttools-4.53.0-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:ee595d7ba9bba130b2bec555a40aafa60c26ce68ed0cf509983e0f12d88674fd"}, + {file = "fonttools-4.53.0-cp38-cp38-win32.whl", hash = "sha256:fca66d9ff2ac89b03f5aa17e0b21a97c21f3491c46b583bb131eb32c7bab33af"}, + {file = "fonttools-4.53.0-cp38-cp38-win_amd64.whl", hash = "sha256:31f0e3147375002aae30696dd1dc596636abbd22fca09d2e730ecde0baad1d6b"}, + {file = "fonttools-4.53.0-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:7d6166192dcd925c78a91d599b48960e0a46fe565391c79fe6de481ac44d20ac"}, + {file = "fonttools-4.53.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ef50ec31649fbc3acf6afd261ed89d09eb909b97cc289d80476166df8438524d"}, + {file = "fonttools-4.53.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f193f060391a455920d61684a70017ef5284ccbe6023bb056e15e5ac3de11d1"}, + {file = "fonttools-4.53.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ba9f09ff17f947392a855e3455a846f9855f6cf6bec33e9a427d3c1d254c712f"}, + {file = "fonttools-4.53.0-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:0c555e039d268445172b909b1b6bdcba42ada1cf4a60e367d68702e3f87e5f64"}, + {file = "fonttools-4.53.0-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:5a4788036201c908079e89ae3f5399b33bf45b9ea4514913f4dbbe4fac08efe0"}, + {file = "fonttools-4.53.0-cp39-cp39-win32.whl", hash = "sha256:d1a24f51a3305362b94681120c508758a88f207fa0a681c16b5a4172e9e6c7a9"}, + {file = "fonttools-4.53.0-cp39-cp39-win_amd64.whl", hash = "sha256:1e677bfb2b4bd0e5e99e0f7283e65e47a9814b0486cb64a41adf9ef110e078f2"}, + {file = "fonttools-4.53.0-py3-none-any.whl", hash = "sha256:6b4f04b1fbc01a3569d63359f2227c89ab294550de277fd09d8fca6185669fa4"}, + {file = "fonttools-4.53.0.tar.gz", hash = "sha256:c93ed66d32de1559b6fc348838c7572d5c0ac1e4a258e76763a5caddd8944002"}, ] [package.extras] @@ -1372,13 +1414,13 @@ woff = ["brotli (>=1.0.1)", "brotlicffi (>=0.8.0)", "zopfli (>=0.1.4)"] [[package]] name = "fsspec" -version = "2024.3.1" +version = "2024.6.0" description = "File-system specification" optional = false python-versions = ">=3.8" files = [ - {file = "fsspec-2024.3.1-py3-none-any.whl", hash = "sha256:918d18d41bf73f0e2b261824baeb1b124bcf771767e3a26425cd7dec3332f512"}, - {file = "fsspec-2024.3.1.tar.gz", hash = "sha256:f39780e282d7d117ffb42bb96992f8a90795e4d0fb0f661a70ca39fe9c43ded9"}, + {file = "fsspec-2024.6.0-py3-none-any.whl", hash = "sha256:58d7122eb8a1a46f7f13453187bfea4972d66bf01618d37366521b1998034cee"}, + {file = "fsspec-2024.6.0.tar.gz", hash = "sha256:f579960a56e6d8038a9efc8f9c77279ec12e6299aa86b0769a7e9c46b94527c2"}, ] [package.extras] @@ -1386,7 +1428,8 @@ abfs = ["adlfs"] adl = ["adlfs"] arrow = ["pyarrow (>=1)"] dask = ["dask", "distributed"] -devel = ["pytest", "pytest-cov"] +dev = ["pre-commit", "ruff"] +doc = ["numpydoc", "sphinx", "sphinx-design", "sphinx-rtd-theme", "yarl"] dropbox = ["dropbox", "dropboxdrivefs", "requests"] full = ["adlfs", "aiohttp (!=4.0.0a0,!=4.0.0a1)", "dask", "distributed", "dropbox", "dropboxdrivefs", "fusepy", "gcsfs", "libarchive-c", "ocifs", "panel", "paramiko", "pyarrow (>=1)", "pygit2", "requests", "s3fs", "smbprotocol", "tqdm"] fuse = ["fusepy"] @@ -1403,6 +1446,9 @@ s3 = ["s3fs"] sftp = ["paramiko"] smb = ["smbprotocol"] ssh = ["paramiko"] +test = ["aiohttp (!=4.0.0a0,!=4.0.0a1)", "numpy", "pytest", "pytest-asyncio (!=0.22.0)", "pytest-benchmark", "pytest-cov", "pytest-mock", "pytest-recording", "pytest-rerunfailures", "requests"] +test-downstream = ["aiobotocore (>=2.5.4,<3.0.0)", "dask-expr", "dask[dataframe,test]", "moto[server] (>4,<5)", "pytest-timeout", "xarray"] +test-full = ["adlfs", "aiohttp (!=4.0.0a0,!=4.0.0a1)", "cloudpickle", "dask", "distributed", "dropbox", "dropboxdrivefs", "fastparquet", "fusepy", "gcsfs", "jinja2", "kerchunk", "libarchive-c", "lz4", "notebook", "numpy", "ocifs", "pandas", "panel", "paramiko", "pyarrow", "pyarrow (>=1)", "pyftpdlib", "pygit2", "pytest", "pytest-asyncio (!=0.22.0)", "pytest-benchmark", "pytest-cov", "pytest-mock", "pytest-recording", "pytest-rerunfailures", "python-snappy", "requests", "smbprotocol", "tqdm", "urllib3", "zarr", "zstandard"] tqdm = ["tqdm"] [[package]] @@ -1446,13 +1492,13 @@ files = [ [[package]] name = "google-api-core" -version = "2.18.0" +version = "2.19.0" description = "Google API client core library" optional = false python-versions = ">=3.7" files = [ - {file = "google-api-core-2.18.0.tar.gz", hash = "sha256:62d97417bfc674d6cef251e5c4d639a9655e00c45528c4364fbfebb478ce72a9"}, - {file = "google_api_core-2.18.0-py3-none-any.whl", hash = "sha256:5a63aa102e0049abe85b5b88cb9409234c1f70afcda21ce1e40b285b9629c1d6"}, + {file = "google-api-core-2.19.0.tar.gz", hash = "sha256:cf1b7c2694047886d2af1128a03ae99e391108a08804f87cfd35970e49c9cd10"}, + {file = "google_api_core-2.19.0-py3-none-any.whl", hash = "sha256:8661eec4078c35428fd3f69a2c7ee29e342896b70f01d1a1cbcb334372dd6251"}, ] [package.dependencies] @@ -1477,13 +1523,13 @@ grpcio-gcp = ["grpcio-gcp (>=0.2.2,<1.0.dev0)"] [[package]] name = "google-auth" -version = "2.29.0" +version = "2.30.0" description = "Google Authentication Library" optional = false python-versions = ">=3.7" files = [ - {file = "google-auth-2.29.0.tar.gz", hash = "sha256:672dff332d073227550ffc7457868ac4218d6c500b155fe6cc17d2b13602c360"}, - {file = "google_auth-2.29.0-py2.py3-none-any.whl", hash = "sha256:d452ad095688cd52bae0ad6fafe027f6a6d6f560e810fec20914e17a09526415"}, + {file = "google-auth-2.30.0.tar.gz", hash = "sha256:ab630a1320f6720909ad76a7dbdb6841cdf5c66b328d690027e4867bdfb16688"}, + {file = "google_auth-2.30.0-py2.py3-none-any.whl", hash = "sha256:8df7da660f62757388b8a7f249df13549b3373f24388cb5d2f1dd91cc18180b5"}, ] [package.dependencies] @@ -1515,86 +1561,78 @@ six = "*" [[package]] name = "googleapis-common-protos" -version = "1.63.0" +version = "1.63.1" description = "Common protobufs used in Google APIs" optional = false python-versions = ">=3.7" files = [ - {file = "googleapis-common-protos-1.63.0.tar.gz", hash = "sha256:17ad01b11d5f1d0171c06d3ba5c04c54474e883b66b949722b4938ee2694ef4e"}, - {file = "googleapis_common_protos-1.63.0-py2.py3-none-any.whl", hash = "sha256:ae45f75702f7c08b541f750854a678bd8f534a1a6bace6afe975f1d0a82d6632"}, + {file = "googleapis-common-protos-1.63.1.tar.gz", hash = "sha256:c6442f7a0a6b2a80369457d79e6672bb7dcbaab88e0848302497e3ec80780a6a"}, + {file = "googleapis_common_protos-1.63.1-py2.py3-none-any.whl", hash = "sha256:0e1c2cdfcbc354b76e4a211a35ea35d6926a835cba1377073c4861db904a1877"}, ] [package.dependencies] -protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<5.0.0.dev0" +protobuf = ">=3.19.5,<3.20.0 || >3.20.0,<3.20.1 || >3.20.1,<4.21.1 || >4.21.1,<4.21.2 || >4.21.2,<4.21.3 || >4.21.3,<4.21.4 || >4.21.4,<4.21.5 || >4.21.5,<6.0.0.dev0" [package.extras] grpc = ["grpcio (>=1.44.0,<2.0.0.dev0)"] [[package]] name = "grpcio" -version = "1.62.2" +version = "1.64.1" description = "HTTP/2-based RPC framework" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "grpcio-1.62.2-cp310-cp310-linux_armv7l.whl", hash = "sha256:66344ea741124c38588a664237ac2fa16dfd226964cca23ddc96bd4accccbde5"}, - {file = "grpcio-1.62.2-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:5dab7ac2c1e7cb6179c6bfad6b63174851102cbe0682294e6b1d6f0981ad7138"}, - {file = "grpcio-1.62.2-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:3ad00f3f0718894749d5a8bb0fa125a7980a2f49523731a9b1fabf2b3522aa43"}, - {file = "grpcio-1.62.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2e72ddfee62430ea80133d2cbe788e0d06b12f865765cb24a40009668bd8ea05"}, - {file = "grpcio-1.62.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53d3a59a10af4c2558a8e563aed9f256259d2992ae0d3037817b2155f0341de1"}, - {file = "grpcio-1.62.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:a1511a303f8074f67af4119275b4f954189e8313541da7b88b1b3a71425cdb10"}, - {file = "grpcio-1.62.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b94d41b7412ef149743fbc3178e59d95228a7064c5ab4760ae82b562bdffb199"}, - {file = "grpcio-1.62.2-cp310-cp310-win32.whl", hash = "sha256:a75af2fc7cb1fe25785be7bed1ab18cef959a376cdae7c6870184307614caa3f"}, - {file = "grpcio-1.62.2-cp310-cp310-win_amd64.whl", hash = "sha256:80407bc007754f108dc2061e37480238b0dc1952c855e86a4fc283501ee6bb5d"}, - {file = "grpcio-1.62.2-cp311-cp311-linux_armv7l.whl", hash = "sha256:c1624aa686d4b36790ed1c2e2306cc3498778dffaf7b8dd47066cf819028c3ad"}, - {file = "grpcio-1.62.2-cp311-cp311-macosx_10_10_universal2.whl", hash = "sha256:1c1bb80299bdef33309dff03932264636450c8fdb142ea39f47e06a7153d3063"}, - {file = "grpcio-1.62.2-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:db068bbc9b1fa16479a82e1ecf172a93874540cb84be69f0b9cb9b7ac3c82670"}, - {file = "grpcio-1.62.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e2cc8a308780edbe2c4913d6a49dbdb5befacdf72d489a368566be44cadaef1a"}, - {file = "grpcio-1.62.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d0695ae31a89f1a8fc8256050329a91a9995b549a88619263a594ca31b76d756"}, - {file = "grpcio-1.62.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:88b4f9ee77191dcdd8810241e89340a12cbe050be3e0d5f2f091c15571cd3930"}, - {file = "grpcio-1.62.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2a0204532aa2f1afd467024b02b4069246320405bc18abec7babab03e2644e75"}, - {file = "grpcio-1.62.2-cp311-cp311-win32.whl", hash = "sha256:6e784f60e575a0de554ef9251cbc2ceb8790914fe324f11e28450047f264ee6f"}, - {file = "grpcio-1.62.2-cp311-cp311-win_amd64.whl", hash = "sha256:112eaa7865dd9e6d7c0556c8b04ae3c3a2dc35d62ad3373ab7f6a562d8199200"}, - {file = "grpcio-1.62.2-cp312-cp312-linux_armv7l.whl", hash = "sha256:65034473fc09628a02fb85f26e73885cf1ed39ebd9cf270247b38689ff5942c5"}, - {file = "grpcio-1.62.2-cp312-cp312-macosx_10_10_universal2.whl", hash = "sha256:d2c1771d0ee3cf72d69bb5e82c6a82f27fbd504c8c782575eddb7839729fbaad"}, - {file = "grpcio-1.62.2-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:3abe6838196da518863b5d549938ce3159d809218936851b395b09cad9b5d64a"}, - {file = "grpcio-1.62.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c5ffeb269f10cedb4f33142b89a061acda9f672fd1357331dbfd043422c94e9e"}, - {file = "grpcio-1.62.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:404d3b4b6b142b99ba1cff0b2177d26b623101ea2ce51c25ef6e53d9d0d87bcc"}, - {file = "grpcio-1.62.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:262cda97efdabb20853d3b5a4c546a535347c14b64c017f628ca0cc7fa780cc6"}, - {file = "grpcio-1.62.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:17708db5b11b966373e21519c4c73e5a750555f02fde82276ea2a267077c68ad"}, - {file = "grpcio-1.62.2-cp312-cp312-win32.whl", hash = "sha256:b7ec9e2f8ffc8436f6b642a10019fc513722858f295f7efc28de135d336ac189"}, - {file = "grpcio-1.62.2-cp312-cp312-win_amd64.whl", hash = "sha256:aa787b83a3cd5e482e5c79be030e2b4a122ecc6c5c6c4c42a023a2b581fdf17b"}, - {file = "grpcio-1.62.2-cp37-cp37m-linux_armv7l.whl", hash = "sha256:cfd23ad29bfa13fd4188433b0e250f84ec2c8ba66b14a9877e8bce05b524cf54"}, - {file = "grpcio-1.62.2-cp37-cp37m-macosx_10_10_universal2.whl", hash = "sha256:af15e9efa4d776dfcecd1d083f3ccfb04f876d613e90ef8432432efbeeac689d"}, - {file = "grpcio-1.62.2-cp37-cp37m-manylinux_2_17_aarch64.whl", hash = "sha256:f4aa94361bb5141a45ca9187464ae81a92a2a135ce2800b2203134f7a1a1d479"}, - {file = "grpcio-1.62.2-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82af3613a219512a28ee5c95578eb38d44dd03bca02fd918aa05603c41018051"}, - {file = "grpcio-1.62.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:55ddaf53474e8caeb29eb03e3202f9d827ad3110475a21245f3c7712022882a9"}, - {file = "grpcio-1.62.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c79b518c56dddeec79e5500a53d8a4db90da995dfe1738c3ac57fe46348be049"}, - {file = "grpcio-1.62.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a5eb4844e5e60bf2c446ef38c5b40d7752c6effdee882f716eb57ae87255d20a"}, - {file = "grpcio-1.62.2-cp37-cp37m-win_amd64.whl", hash = "sha256:aaae70364a2d1fb238afd6cc9fcb10442b66e397fd559d3f0968d28cc3ac929c"}, - {file = "grpcio-1.62.2-cp38-cp38-linux_armv7l.whl", hash = "sha256:1bcfe5070e4406f489e39325b76caeadab28c32bf9252d3ae960c79935a4cc36"}, - {file = "grpcio-1.62.2-cp38-cp38-macosx_10_10_universal2.whl", hash = "sha256:da6a7b6b938c15fa0f0568e482efaae9c3af31963eec2da4ff13a6d8ec2888e4"}, - {file = "grpcio-1.62.2-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:41955b641c34db7d84db8d306937b72bc4968eef1c401bea73081a8d6c3d8033"}, - {file = "grpcio-1.62.2-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c772f225483905f675cb36a025969eef9712f4698364ecd3a63093760deea1bc"}, - {file = "grpcio-1.62.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:07ce1f775d37ca18c7a141300e5b71539690efa1f51fe17f812ca85b5e73262f"}, - {file = "grpcio-1.62.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:26f415f40f4a93579fd648f48dca1c13dfacdfd0290f4a30f9b9aeb745026811"}, - {file = "grpcio-1.62.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:db707e3685ff16fc1eccad68527d072ac8bdd2e390f6daa97bc394ea7de4acea"}, - {file = "grpcio-1.62.2-cp38-cp38-win32.whl", hash = "sha256:589ea8e75de5fd6df387de53af6c9189c5231e212b9aa306b6b0d4f07520fbb9"}, - {file = "grpcio-1.62.2-cp38-cp38-win_amd64.whl", hash = "sha256:3c3ed41f4d7a3aabf0f01ecc70d6b5d00ce1800d4af652a549de3f7cf35c4abd"}, - {file = "grpcio-1.62.2-cp39-cp39-linux_armv7l.whl", hash = "sha256:162ccf61499c893831b8437120600290a99c0bc1ce7b51f2c8d21ec87ff6af8b"}, - {file = "grpcio-1.62.2-cp39-cp39-macosx_10_10_universal2.whl", hash = "sha256:f27246d7da7d7e3bd8612f63785a7b0c39a244cf14b8dd9dd2f2fab939f2d7f1"}, - {file = "grpcio-1.62.2-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:2507006c8a478f19e99b6fe36a2464696b89d40d88f34e4b709abe57e1337467"}, - {file = "grpcio-1.62.2-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a90ac47a8ce934e2c8d71e317d2f9e7e6aaceb2d199de940ce2c2eb611b8c0f4"}, - {file = "grpcio-1.62.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:99701979bcaaa7de8d5f60476487c5df8f27483624f1f7e300ff4669ee44d1f2"}, - {file = "grpcio-1.62.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:af7dc3f7a44f10863b1b0ecab4078f0a00f561aae1edbd01fd03ad4dcf61c9e9"}, - {file = "grpcio-1.62.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:fa63245271920786f4cb44dcada4983a3516be8f470924528cf658731864c14b"}, - {file = "grpcio-1.62.2-cp39-cp39-win32.whl", hash = "sha256:c6ad9c39704256ed91a1cffc1379d63f7d0278d6a0bad06b0330f5d30291e3a3"}, - {file = "grpcio-1.62.2-cp39-cp39-win_amd64.whl", hash = "sha256:16da954692fd61aa4941fbeda405a756cd96b97b5d95ca58a92547bba2c1624f"}, - {file = "grpcio-1.62.2.tar.gz", hash = "sha256:c77618071d96b7a8be2c10701a98537823b9c65ba256c0b9067e0594cdbd954d"}, + {file = "grpcio-1.64.1-cp310-cp310-linux_armv7l.whl", hash = "sha256:55697ecec192bc3f2f3cc13a295ab670f51de29884ca9ae6cd6247df55df2502"}, + {file = "grpcio-1.64.1-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:3b64ae304c175671efdaa7ec9ae2cc36996b681eb63ca39c464958396697daff"}, + {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:bac71b4b28bc9af61efcdc7630b166440bbfbaa80940c9a697271b5e1dabbc61"}, + {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6c024ffc22d6dc59000faf8ad781696d81e8e38f4078cb0f2630b4a3cf231a90"}, + {file = "grpcio-1.64.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e7cd5c1325f6808b8ae31657d281aadb2a51ac11ab081ae335f4f7fc44c1721d"}, + {file = "grpcio-1.64.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:0a2813093ddb27418a4c99f9b1c223fab0b053157176a64cc9db0f4557b69bd9"}, + {file = "grpcio-1.64.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2981c7365a9353f9b5c864595c510c983251b1ab403e05b1ccc70a3d9541a73b"}, + {file = "grpcio-1.64.1-cp310-cp310-win32.whl", hash = "sha256:1262402af5a511c245c3ae918167eca57342c72320dffae5d9b51840c4b2f86d"}, + {file = "grpcio-1.64.1-cp310-cp310-win_amd64.whl", hash = "sha256:19264fc964576ddb065368cae953f8d0514ecc6cb3da8903766d9fb9d4554c33"}, + {file = "grpcio-1.64.1-cp311-cp311-linux_armv7l.whl", hash = "sha256:58b1041e7c870bb30ee41d3090cbd6f0851f30ae4eb68228955d973d3efa2e61"}, + {file = "grpcio-1.64.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:bbc5b1d78a7822b0a84c6f8917faa986c1a744e65d762ef6d8be9d75677af2ca"}, + {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:5841dd1f284bd1b3d8a6eca3a7f062b06f1eec09b184397e1d1d43447e89a7ae"}, + {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8caee47e970b92b3dd948371230fcceb80d3f2277b3bf7fbd7c0564e7d39068e"}, + {file = "grpcio-1.64.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:73819689c169417a4f978e562d24f2def2be75739c4bed1992435d007819da1b"}, + {file = "grpcio-1.64.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6503b64c8b2dfad299749cad1b595c650c91e5b2c8a1b775380fcf8d2cbba1e9"}, + {file = "grpcio-1.64.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1de403fc1305fd96cfa75e83be3dee8538f2413a6b1685b8452301c7ba33c294"}, + {file = "grpcio-1.64.1-cp311-cp311-win32.whl", hash = "sha256:d4d29cc612e1332237877dfa7fe687157973aab1d63bd0f84cf06692f04c0367"}, + {file = "grpcio-1.64.1-cp311-cp311-win_amd64.whl", hash = "sha256:5e56462b05a6f860b72f0fa50dca06d5b26543a4e88d0396259a07dc30f4e5aa"}, + {file = "grpcio-1.64.1-cp312-cp312-linux_armv7l.whl", hash = "sha256:4657d24c8063e6095f850b68f2d1ba3b39f2b287a38242dcabc166453e950c59"}, + {file = "grpcio-1.64.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:62b4e6eb7bf901719fce0ca83e3ed474ae5022bb3827b0a501e056458c51c0a1"}, + {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:ee73a2f5ca4ba44fa33b4d7d2c71e2c8a9e9f78d53f6507ad68e7d2ad5f64a22"}, + {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:198908f9b22e2672a998870355e226a725aeab327ac4e6ff3a1399792ece4762"}, + {file = "grpcio-1.64.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:39b9d0acaa8d835a6566c640f48b50054f422d03e77e49716d4c4e8e279665a1"}, + {file = "grpcio-1.64.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:5e42634a989c3aa6049f132266faf6b949ec2a6f7d302dbb5c15395b77d757eb"}, + {file = "grpcio-1.64.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b1a82e0b9b3022799c336e1fc0f6210adc019ae84efb7321d668129d28ee1efb"}, + {file = "grpcio-1.64.1-cp312-cp312-win32.whl", hash = "sha256:55260032b95c49bee69a423c2f5365baa9369d2f7d233e933564d8a47b893027"}, + {file = "grpcio-1.64.1-cp312-cp312-win_amd64.whl", hash = "sha256:c1a786ac592b47573a5bb7e35665c08064a5d77ab88a076eec11f8ae86b3e3f6"}, + {file = "grpcio-1.64.1-cp38-cp38-linux_armv7l.whl", hash = "sha256:a011ac6c03cfe162ff2b727bcb530567826cec85eb8d4ad2bfb4bd023287a52d"}, + {file = "grpcio-1.64.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:4d6dab6124225496010bd22690f2d9bd35c7cbb267b3f14e7a3eb05c911325d4"}, + {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:a5e771d0252e871ce194d0fdcafd13971f1aae0ddacc5f25615030d5df55c3a2"}, + {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2c3c1b90ab93fed424e454e93c0ed0b9d552bdf1b0929712b094f5ecfe7a23ad"}, + {file = "grpcio-1.64.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:20405cb8b13fd779135df23fabadc53b86522d0f1cba8cca0e87968587f50650"}, + {file = "grpcio-1.64.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0cc79c982ccb2feec8aad0e8fb0d168bcbca85bc77b080d0d3c5f2f15c24ea8f"}, + {file = "grpcio-1.64.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:a3a035c37ce7565b8f4f35ff683a4db34d24e53dc487e47438e434eb3f701b2a"}, + {file = "grpcio-1.64.1-cp38-cp38-win32.whl", hash = "sha256:1257b76748612aca0f89beec7fa0615727fd6f2a1ad580a9638816a4b2eb18fd"}, + {file = "grpcio-1.64.1-cp38-cp38-win_amd64.whl", hash = "sha256:0a12ddb1678ebc6a84ec6b0487feac020ee2b1659cbe69b80f06dbffdb249122"}, + {file = "grpcio-1.64.1-cp39-cp39-linux_armv7l.whl", hash = "sha256:75dbbf415026d2862192fe1b28d71f209e2fd87079d98470db90bebe57b33179"}, + {file = "grpcio-1.64.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e3d9f8d1221baa0ced7ec7322a981e28deb23749c76eeeb3d33e18b72935ab62"}, + {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:5f8b75f64d5d324c565b263c67dbe4f0af595635bbdd93bb1a88189fc62ed2e5"}, + {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c84ad903d0d94311a2b7eea608da163dace97c5fe9412ea311e72c3684925602"}, + {file = "grpcio-1.64.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:940e3ec884520155f68a3b712d045e077d61c520a195d1a5932c531f11883489"}, + {file = "grpcio-1.64.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f10193c69fc9d3d726e83bbf0f3d316f1847c3071c8c93d8090cf5f326b14309"}, + {file = "grpcio-1.64.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ac15b6c2c80a4d1338b04d42a02d376a53395ddf0ec9ab157cbaf44191f3ffdd"}, + {file = "grpcio-1.64.1-cp39-cp39-win32.whl", hash = "sha256:03b43d0ccf99c557ec671c7dede64f023c7da9bb632ac65dbc57f166e4970040"}, + {file = "grpcio-1.64.1-cp39-cp39-win_amd64.whl", hash = "sha256:ed6091fa0adcc7e4ff944090cf203a52da35c37a130efa564ded02b7aff63bcd"}, + {file = "grpcio-1.64.1.tar.gz", hash = "sha256:8d51dd1c59d5fa0f34266b80a3805ec29a1f26425c2a54736133f6d87fc4968a"}, ] [package.extras] -protobuf = ["grpcio-tools (>=1.62.2)"] +protobuf = ["grpcio-tools (>=1.64.1)"] [[package]] name = "grpcio-status" @@ -1811,6 +1849,39 @@ files = [ {file = "intel_openmp-2021.4.0-py2.py3-none-win_amd64.whl", hash = "sha256:eef4c8bcc8acefd7f5cd3b9384dbf73d59e2c99fc56545712ded913f43c4a94f"}, ] +[[package]] +name = "ipykernel" +version = "6.29.4" +description = "IPython Kernel for Jupyter" +optional = false +python-versions = ">=3.8" +files = [ + {file = "ipykernel-6.29.4-py3-none-any.whl", hash = "sha256:1181e653d95c6808039c509ef8e67c4126b3b3af7781496c7cbfb5ed938a27da"}, + {file = "ipykernel-6.29.4.tar.gz", hash = "sha256:3d44070060f9475ac2092b760123fadf105d2e2493c24848b6691a7c4f42af5c"}, +] + +[package.dependencies] +appnope = {version = "*", markers = "platform_system == \"Darwin\""} +comm = ">=0.1.1" +debugpy = ">=1.6.5" +ipython = ">=7.23.1" +jupyter-client = ">=6.1.12" +jupyter-core = ">=4.12,<5.0.dev0 || >=5.1.dev0" +matplotlib-inline = ">=0.1" +nest-asyncio = "*" +packaging = "*" +psutil = "*" +pyzmq = ">=24" +tornado = ">=6.1" +traitlets = ">=5.4.0" + +[package.extras] +cov = ["coverage[toml]", "curio", "matplotlib", "pytest-cov", "trio"] +docs = ["myst-parser", "pydata-sphinx-theme", "sphinx", "sphinx-autodoc-typehints", "sphinxcontrib-github-alt", "sphinxcontrib-spelling", "trio"] +pyqt5 = ["pyqt5"] +pyside6 = ["pyside6"] +test = ["flaky", "ipyparallel", "pre-commit", "pytest (>=7.0)", "pytest-asyncio (>=0.23.5)", "pytest-cov", "pytest-timeout"] + [[package]] name = "ipython" version = "8.18.1" @@ -1850,21 +1921,21 @@ test-extra = ["curio", "matplotlib (!=3.2.0)", "nbformat", "numpy (>=1.22)", "pa [[package]] name = "ipywidgets" -version = "8.1.2" +version = "8.1.3" description = "Jupyter interactive widgets" optional = false python-versions = ">=3.7" files = [ - {file = "ipywidgets-8.1.2-py3-none-any.whl", hash = "sha256:bbe43850d79fb5e906b14801d6c01402857996864d1e5b6fa62dd2ee35559f60"}, - {file = "ipywidgets-8.1.2.tar.gz", hash = "sha256:d0b9b41e49bae926a866e613a39b0f0097745d2b9f1f3dd406641b4a57ec42c9"}, + {file = "ipywidgets-8.1.3-py3-none-any.whl", hash = "sha256:efafd18f7a142248f7cb0ba890a68b96abd4d6e88ddbda483c9130d12667eaf2"}, + {file = "ipywidgets-8.1.3.tar.gz", hash = "sha256:f5f9eeaae082b1823ce9eac2575272952f40d748893972956dc09700a6392d9c"}, ] [package.dependencies] comm = ">=0.1.3" ipython = ">=6.1.0" -jupyterlab-widgets = ">=3.0.10,<3.1.0" +jupyterlab-widgets = ">=3.0.11,<3.1.0" traitlets = ">=4.3.1" -widgetsnbextension = ">=4.0.10,<4.1.0" +widgetsnbextension = ">=4.0.11,<4.1.0" [package.extras] test = ["ipykernel", "jsonschema", "pytest (>=3.6.0)", "pytest-cov", "pytz"] @@ -1915,13 +1986,13 @@ testing = ["Django", "attrs", "colorama", "docopt", "pytest (<7.0.0)"] [[package]] name = "jinja2" -version = "3.1.3" +version = "3.1.4" description = "A very fast and expressive template engine." optional = false python-versions = ">=3.7" files = [ - {file = "Jinja2-3.1.3-py3-none-any.whl", hash = "sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa"}, - {file = "Jinja2-3.1.3.tar.gz", hash = "sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90"}, + {file = "jinja2-3.1.4-py3-none-any.whl", hash = "sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d"}, + {file = "jinja2-3.1.4.tar.gz", hash = "sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369"}, ] [package.dependencies] @@ -1932,13 +2003,13 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "joblib" -version = "1.4.0" +version = "1.4.2" description = "Lightweight pipelining with Python functions" optional = false python-versions = ">=3.8" files = [ - {file = "joblib-1.4.0-py3-none-any.whl", hash = "sha256:42942470d4062537be4d54c83511186da1fc14ba354961a2114da91efa9a4ed7"}, - {file = "joblib-1.4.0.tar.gz", hash = "sha256:1eb0dc091919cd384490de890cb5dfd538410a6d4b3b54eef09fb8c50b409b1c"}, + {file = "joblib-1.4.2-py3-none-any.whl", hash = "sha256:06d478d5674cbc267e7496a410ee875abd68e4340feff4490bcb7afb88060ae6"}, + {file = "joblib-1.4.2.tar.gz", hash = "sha256:2382c5816b2636fbd20a09e0f4e9dad4736765fdfb7dca582943b9c1366b3f0e"}, ] [[package]] @@ -1962,13 +2033,13 @@ format-nongpl = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339- [[package]] name = "jupyter-client" -version = "8.6.1" +version = "8.6.2" description = "Jupyter protocol implementation and client libraries" optional = false python-versions = ">=3.8" files = [ - {file = "jupyter_client-8.6.1-py3-none-any.whl", hash = "sha256:3b7bd22f058434e3b9a7ea4b1500ed47de2713872288c0d511d19926f99b459f"}, - {file = "jupyter_client-8.6.1.tar.gz", hash = "sha256:e842515e2bab8e19186d89fdfea7abd15e39dd581f94e399f00e2af5a1652d3f"}, + {file = "jupyter_client-8.6.2-py3-none-any.whl", hash = "sha256:50cbc5c66fd1b8f65ecb66bc490ab73217993632809b6e505687de18e9dea39f"}, + {file = "jupyter_client-8.6.2.tar.gz", hash = "sha256:2bda14d55ee5ba58552a8c53ae43d215ad9868853489213f37da060ced54d8df"}, ] [package.dependencies] @@ -1981,7 +2052,7 @@ traitlets = ">=5.3" [package.extras] docs = ["ipykernel", "myst-parser", "pydata-sphinx-theme", "sphinx (>=4)", "sphinx-autodoc-typehints", "sphinxcontrib-github-alt", "sphinxcontrib-spelling"] -test = ["coverage", "ipykernel (>=6.14)", "mypy", "paramiko", "pre-commit", "pytest", "pytest-cov", "pytest-jupyter[client] (>=0.4.1)", "pytest-timeout"] +test = ["coverage", "ipykernel (>=6.14)", "mypy", "paramiko", "pre-commit", "pytest (<8.2.0)", "pytest-cov", "pytest-jupyter[client] (>=0.4.1)", "pytest-timeout"] [[package]] name = "jupyter-core" @@ -2016,13 +2087,13 @@ files = [ [[package]] name = "jupyterlab-widgets" -version = "3.0.10" +version = "3.0.11" description = "Jupyter interactive widgets for JupyterLab" optional = false python-versions = ">=3.7" files = [ - {file = "jupyterlab_widgets-3.0.10-py3-none-any.whl", hash = "sha256:dd61f3ae7a5a7f80299e14585ce6cf3d6925a96c9103c978eda293197730cb64"}, - {file = "jupyterlab_widgets-3.0.10.tar.gz", hash = "sha256:04f2ac04976727e4f9d0fa91cdc2f1ab860f965e504c29dbd6a65c882c9d04c0"}, + {file = "jupyterlab_widgets-3.0.11-py3-none-any.whl", hash = "sha256:78287fd86d20744ace330a61625024cf5521e1c012a352ddc0a3cdc2348becd0"}, + {file = "jupyterlab_widgets-3.0.11.tar.gz", hash = "sha256:dd5ac679593c969af29c9bed054c24f26842baa51352114736756bc035deee27"}, ] [[package]] @@ -2345,39 +2416,40 @@ files = [ [[package]] name = "matplotlib" -version = "3.8.4" +version = "3.9.0" description = "Python plotting package" optional = false python-versions = ">=3.9" files = [ - {file = "matplotlib-3.8.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:abc9d838f93583650c35eca41cfcec65b2e7cb50fd486da6f0c49b5e1ed23014"}, - {file = "matplotlib-3.8.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f65c9f002d281a6e904976007b2d46a1ee2bcea3a68a8c12dda24709ddc9106"}, - {file = "matplotlib-3.8.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ce1edd9f5383b504dbc26eeea404ed0a00656c526638129028b758fd43fc5f10"}, - {file = "matplotlib-3.8.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecd79298550cba13a43c340581a3ec9c707bd895a6a061a78fa2524660482fc0"}, - {file = "matplotlib-3.8.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:90df07db7b599fe7035d2f74ab7e438b656528c68ba6bb59b7dc46af39ee48ef"}, - {file = "matplotlib-3.8.4-cp310-cp310-win_amd64.whl", hash = "sha256:ac24233e8f2939ac4fd2919eed1e9c0871eac8057666070e94cbf0b33dd9c338"}, - {file = "matplotlib-3.8.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:72f9322712e4562e792b2961971891b9fbbb0e525011e09ea0d1f416c4645661"}, - {file = "matplotlib-3.8.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:232ce322bfd020a434caaffbd9a95333f7c2491e59cfc014041d95e38ab90d1c"}, - {file = "matplotlib-3.8.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6addbd5b488aedb7f9bc19f91cd87ea476206f45d7116fcfe3d31416702a82fa"}, - {file = "matplotlib-3.8.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cc4ccdc64e3039fc303defd119658148f2349239871db72cd74e2eeaa9b80b71"}, - {file = "matplotlib-3.8.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:b7a2a253d3b36d90c8993b4620183b55665a429da8357a4f621e78cd48b2b30b"}, - {file = "matplotlib-3.8.4-cp311-cp311-win_amd64.whl", hash = "sha256:8080d5081a86e690d7688ffa542532e87f224c38a6ed71f8fbed34dd1d9fedae"}, - {file = "matplotlib-3.8.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6485ac1f2e84676cff22e693eaa4fbed50ef5dc37173ce1f023daef4687df616"}, - {file = "matplotlib-3.8.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c89ee9314ef48c72fe92ce55c4e95f2f39d70208f9f1d9db4e64079420d8d732"}, - {file = "matplotlib-3.8.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:50bac6e4d77e4262c4340d7a985c30912054745ec99756ce213bfbc3cb3808eb"}, - {file = "matplotlib-3.8.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f51c4c869d4b60d769f7b4406eec39596648d9d70246428745a681c327a8ad30"}, - {file = "matplotlib-3.8.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:b12ba985837e4899b762b81f5b2845bd1a28f4fdd1a126d9ace64e9c4eb2fb25"}, - {file = "matplotlib-3.8.4-cp312-cp312-win_amd64.whl", hash = "sha256:7a6769f58ce51791b4cb8b4d7642489df347697cd3e23d88266aaaee93b41d9a"}, - {file = "matplotlib-3.8.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:843cbde2f0946dadd8c5c11c6d91847abd18ec76859dc319362a0964493f0ba6"}, - {file = "matplotlib-3.8.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:1c13f041a7178f9780fb61cc3a2b10423d5e125480e4be51beaf62b172413b67"}, - {file = "matplotlib-3.8.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fb44f53af0a62dc80bba4443d9b27f2fde6acfdac281d95bc872dc148a6509cc"}, - {file = "matplotlib-3.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:606e3b90897554c989b1e38a258c626d46c873523de432b1462f295db13de6f9"}, - {file = "matplotlib-3.8.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9bb0189011785ea794ee827b68777db3ca3f93f3e339ea4d920315a0e5a78d54"}, - {file = "matplotlib-3.8.4-cp39-cp39-win_amd64.whl", hash = "sha256:6209e5c9aaccc056e63b547a8152661324404dd92340a6e479b3a7f24b42a5d0"}, - {file = "matplotlib-3.8.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c7064120a59ce6f64103c9cefba8ffe6fba87f2c61d67c401186423c9a20fd35"}, - {file = "matplotlib-3.8.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a0e47eda4eb2614300fc7bb4657fced3e83d6334d03da2173b09e447418d499f"}, - {file = "matplotlib-3.8.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:493e9f6aa5819156b58fce42b296ea31969f2aab71c5b680b4ea7a3cb5c07d94"}, - {file = "matplotlib-3.8.4.tar.gz", hash = "sha256:8aac397d5e9ec158960e31c381c5ffc52ddd52bd9a47717e2a694038167dffea"}, + {file = "matplotlib-3.9.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2bcee1dffaf60fe7656183ac2190bd630842ff87b3153afb3e384d966b57fe56"}, + {file = "matplotlib-3.9.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3f988bafb0fa39d1074ddd5bacd958c853e11def40800c5824556eb630f94d3b"}, + {file = "matplotlib-3.9.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fe428e191ea016bb278758c8ee82a8129c51d81d8c4bc0846c09e7e8e9057241"}, + {file = "matplotlib-3.9.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eaf3978060a106fab40c328778b148f590e27f6fa3cd15a19d6892575bce387d"}, + {file = "matplotlib-3.9.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:2e7f03e5cbbfacdd48c8ea394d365d91ee8f3cae7e6ec611409927b5ed997ee4"}, + {file = "matplotlib-3.9.0-cp310-cp310-win_amd64.whl", hash = "sha256:13beb4840317d45ffd4183a778685e215939be7b08616f431c7795276e067463"}, + {file = "matplotlib-3.9.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:063af8587fceeac13b0936c42a2b6c732c2ab1c98d38abc3337e430e1ff75e38"}, + {file = "matplotlib-3.9.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:9a2fa6d899e17ddca6d6526cf6e7ba677738bf2a6a9590d702c277204a7c6152"}, + {file = "matplotlib-3.9.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:550cdda3adbd596078cca7d13ed50b77879104e2e46392dcd7c75259d8f00e85"}, + {file = "matplotlib-3.9.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:76cce0f31b351e3551d1f3779420cf8f6ec0d4a8cf9c0237a3b549fd28eb4abb"}, + {file = "matplotlib-3.9.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c53aeb514ccbbcbab55a27f912d79ea30ab21ee0531ee2c09f13800efb272674"}, + {file = "matplotlib-3.9.0-cp311-cp311-win_amd64.whl", hash = "sha256:a5be985db2596d761cdf0c2eaf52396f26e6a64ab46bd8cd810c48972349d1be"}, + {file = "matplotlib-3.9.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:c79f3a585f1368da6049318bdf1f85568d8d04b2e89fc24b7e02cc9b62017382"}, + {file = "matplotlib-3.9.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bdd1ecbe268eb3e7653e04f451635f0fb0f77f07fd070242b44c076c9106da84"}, + {file = "matplotlib-3.9.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d38e85a1a6d732f645f1403ce5e6727fd9418cd4574521d5803d3d94911038e5"}, + {file = "matplotlib-3.9.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0a490715b3b9984fa609116481b22178348c1a220a4499cda79132000a79b4db"}, + {file = "matplotlib-3.9.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8146ce83cbc5dc71c223a74a1996d446cd35cfb6a04b683e1446b7e6c73603b7"}, + {file = "matplotlib-3.9.0-cp312-cp312-win_amd64.whl", hash = "sha256:d91a4ffc587bacf5c4ce4ecfe4bcd23a4b675e76315f2866e588686cc97fccdf"}, + {file = "matplotlib-3.9.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:616fabf4981a3b3c5a15cd95eba359c8489c4e20e03717aea42866d8d0465956"}, + {file = "matplotlib-3.9.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:cd53c79fd02f1c1808d2cfc87dd3cf4dbc63c5244a58ee7944497107469c8d8a"}, + {file = "matplotlib-3.9.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:06a478f0d67636554fa78558cfbcd7b9dba85b51f5c3b5a0c9be49010cf5f321"}, + {file = "matplotlib-3.9.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:81c40af649d19c85f8073e25e5806926986806fa6d54be506fbf02aef47d5a89"}, + {file = "matplotlib-3.9.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:52146fc3bd7813cc784562cb93a15788be0b2875c4655e2cc6ea646bfa30344b"}, + {file = "matplotlib-3.9.0-cp39-cp39-win_amd64.whl", hash = "sha256:0fc51eaa5262553868461c083d9adadb11a6017315f3a757fc45ec6ec5f02888"}, + {file = "matplotlib-3.9.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:bd4f2831168afac55b881db82a7730992aa41c4f007f1913465fb182d6fb20c0"}, + {file = "matplotlib-3.9.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:290d304e59be2b33ef5c2d768d0237f5bd132986bdcc66f80bc9bcc300066a03"}, + {file = "matplotlib-3.9.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ff2e239c26be4f24bfa45860c20ffccd118d270c5b5d081fa4ea409b5469fcd"}, + {file = "matplotlib-3.9.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:af4001b7cae70f7eaacfb063db605280058246de590fa7874f00f62259f2df7e"}, + {file = "matplotlib-3.9.0.tar.gz", hash = "sha256:e6d29ea6c19e34b30fb7d88b7081f869a03014f66fe06d62cc77d5a6ea88ed7a"}, ] [package.dependencies] @@ -2386,12 +2458,15 @@ cycler = ">=0.10" fonttools = ">=4.22.0" importlib-resources = {version = ">=3.2.0", markers = "python_version < \"3.10\""} kiwisolver = ">=1.3.1" -numpy = ">=1.21" +numpy = ">=1.23" packaging = ">=20.0" pillow = ">=8" pyparsing = ">=2.3.1" python-dateutil = ">=2.7" +[package.extras] +dev = ["meson-python (>=0.13.1)", "numpy (>=1.25)", "pybind11 (>=2.6)", "setuptools (>=64)", "setuptools_scm (>=7)"] + [[package]] name = "matplotlib-inline" version = "0.1.7" @@ -2687,6 +2762,17 @@ nbformat = "*" sphinx = ">=1.8" traitlets = ">=5" +[[package]] +name = "nest-asyncio" +version = "1.6.0" +description = "Patch asyncio to allow nested event loops" +optional = false +python-versions = ">=3.5" +files = [ + {file = "nest_asyncio-1.6.0-py3-none-any.whl", hash = "sha256:87af6efd6b5e897c81050477ef65c62e2b2f35d51703cae01aff2905b1852e1c"}, + {file = "nest_asyncio-1.6.0.tar.gz", hash = "sha256:6f172d5449aca15afd6c646851f4e31e02c598d553a667e38cafa997cfec55fe"}, +] + [[package]] name = "networkx" version = "3.2.1" @@ -2906,13 +2992,13 @@ files = [ [[package]] name = "nvidia-nvjitlink-cu12" -version = "12.4.127" +version = "12.5.40" description = "Nvidia JIT LTO Library" optional = false python-versions = ">=3" files = [ - {file = "nvidia_nvjitlink_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl", hash = "sha256:06b3b9b25bf3f8af351d664978ca26a16d2c5127dbd53c0497e28d1fb9611d57"}, - {file = "nvidia_nvjitlink_cu12-12.4.127-py3-none-win_amd64.whl", hash = "sha256:fd9020c501d27d135f983c6d3e244b197a7ccad769e34df53a42e276b0e25fa1"}, + {file = "nvidia_nvjitlink_cu12-12.5.40-py3-none-manylinux2014_x86_64.whl", hash = "sha256:d9714f27c1d0f0895cd8915c07a87a1d0029a0aa36acaf9156952ec2a8a12189"}, + {file = "nvidia_nvjitlink_cu12-12.5.40-py3-none-win_amd64.whl", hash = "sha256:c3401dc8543b52d3a8158007a0c1ab4e9c768fcbd24153a48c86972102197ddd"}, ] [[package]] @@ -3026,13 +3112,13 @@ torch = ["torch"] [[package]] name = "packaging" -version = "24.0" +version = "24.1" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, - {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, + {file = "packaging-24.1-py3-none-any.whl", hash = "sha256:5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"}, + {file = "packaging-24.1.tar.gz", hash = "sha256:026ed72c8ed3fcce5bf8950572258698927fd1dbda10a5e981cdf0ac37f4f002"}, ] [[package]] @@ -3256,13 +3342,13 @@ xmp = ["defusedxml"] [[package]] name = "platformdirs" -version = "4.2.1" +version = "4.2.2" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.2.1-py3-none-any.whl", hash = "sha256:17d5a1161b3fd67b390023cb2d3b026bbd40abde6fdb052dfbd3a29c3ba22ee1"}, - {file = "platformdirs-4.2.1.tar.gz", hash = "sha256:031cd18d4ec63ec53e82dceaac0417d218a6863f7745dfcc9efe7793b7039bdf"}, + {file = "platformdirs-4.2.2-py3-none-any.whl", hash = "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee"}, + {file = "platformdirs-4.2.2.tar.gz", hash = "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3"}, ] [package.extras] @@ -3298,13 +3384,13 @@ files = [ [[package]] name = "prompt-toolkit" -version = "3.0.43" +version = "3.0.47" description = "Library for building powerful interactive command lines in Python" optional = false python-versions = ">=3.7.0" files = [ - {file = "prompt_toolkit-3.0.43-py3-none-any.whl", hash = "sha256:a11a29cb3bf0a28a387fe5122cdb649816a957cd9261dcedf8c9f1fef33eacf6"}, - {file = "prompt_toolkit-3.0.43.tar.gz", hash = "sha256:3527b7af26106cbc65a040bcc84839a3566ec1b051bb0bfe953631e704b0ff7d"}, + {file = "prompt_toolkit-3.0.47-py3-none-any.whl", hash = "sha256:0d7bfa67001d5e39d02c224b663abc33687405033a8c422d0d675a5a13361d10"}, + {file = "prompt_toolkit-3.0.47.tar.gz", hash = "sha256:1e1b29cb58080b1e69f207c893a1a7bf16d127a5c30c9d17a25a5d77792e5360"}, ] [package.dependencies] @@ -3535,17 +3621,16 @@ email = ["email-validator (>=1.0.3)"] [[package]] name = "pygments" -version = "2.17.2" +version = "2.18.0" description = "Pygments is a syntax highlighting package written in Python." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pygments-2.17.2-py3-none-any.whl", hash = "sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c"}, - {file = "pygments-2.17.2.tar.gz", hash = "sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367"}, + {file = "pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a"}, + {file = "pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199"}, ] [package.extras] -plugins = ["importlib-metadata"] windows-terminal = ["colorama (>=0.4.6)"] [[package]] @@ -3754,72 +3839,84 @@ six = ">=1.5" [[package]] name = "python-rapidjson" -version = "1.16" +version = "1.17" description = "Python wrapper around rapidjson" optional = false python-versions = ">=3.6" files = [ - {file = "python-rapidjson-1.16.tar.gz", hash = "sha256:3c9330e9cfd9223cb473384754df9692c18d4ec446ec94ce9ba7dff01a610d05"}, - {file = "python_rapidjson-1.16-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:50f283e3ce8f925da6faf4ed3a3ac3242a1345e49b829c07113849642ac6b356"}, - {file = "python_rapidjson-1.16-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:23239689fa79208639342f3f100af4f59bb969f8f1f6e06a9014eb94f45f9150"}, - {file = "python_rapidjson-1.16-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41443fad179227377b00c39d7cafb49219d0b870110f14776afb8354f56d54f3"}, - {file = "python_rapidjson-1.16-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:092b7276c2fc87d3b9689d4b04cfc0090f6de6588f365ae8154b89083fe315e6"}, - {file = "python_rapidjson-1.16-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:41b3a525ec599ac400489b8e1a9f714992e21178e96ebd1ceb74d0578d0e8a00"}, - {file = "python_rapidjson-1.16-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e366bac8463a0593ac2d52d38c951c60124b5a089bcfedb989a008ff4741b257"}, - {file = "python_rapidjson-1.16-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3a24f7c646baa8661d919b63ac469e49731e89d6f8fab2991be20c7d1b5f6945"}, - {file = "python_rapidjson-1.16-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:bc3d4496c4392744f7bf9a80cf668ce21f44f097eb0089bc5aad9ab5cfaeb00c"}, - {file = "python_rapidjson-1.16-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:cb5ca753143916822d4c8864b81ee633f2671d95c4c3ff8fb8feecc7770cca94"}, - {file = "python_rapidjson-1.16-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:ad196c86150bd1fe0738252731af3dbc7cface85d7136a42066622a59abe00d3"}, - {file = "python_rapidjson-1.16-cp310-cp310-win32.whl", hash = "sha256:c12e7d2e37d5c2feb9e39cbe77e703affd76d508f8bead4046cc71026ca061a2"}, - {file = "python_rapidjson-1.16-cp310-cp310-win_amd64.whl", hash = "sha256:ed4d8cd3ae01b321e5c86897e5eaad9e83c6cf3afce4d1fca0bb16676a947afb"}, - {file = "python_rapidjson-1.16-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:37d51c5defc9bc196c5e5c91270158305402b9174096c0e9e55c1fd919863433"}, - {file = "python_rapidjson-1.16-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:0982f3040e539e0629328f51469e45b680167e5340296360c85f5fc2c25162e3"}, - {file = "python_rapidjson-1.16-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76938e10ce57e603f5330a95c4ab63e4a0f9ea0c7fda9c28da00dcd6e61986ed"}, - {file = "python_rapidjson-1.16-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7596b8f6a2a22542ddabe5012bef743d21f81af40bf2113af05e2ed98ebfd36d"}, - {file = "python_rapidjson-1.16-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:184ae8afe84002afae957657424bf05a46da62ace567a7a1b80113f9848a7873"}, - {file = "python_rapidjson-1.16-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:04b2cab59533e6cd58294eb9c237e7bf6b2d6136826a299b611ef33adeb3da89"}, - {file = "python_rapidjson-1.16-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:40eac66499740cb6f176132e05cf6fa4f6d116056f081bcfb496bdc5a1c2562a"}, - {file = "python_rapidjson-1.16-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:f1f30ad25381ee426d559f83cd3e4267664973b88265f3d440b63bdeee4a2155"}, - {file = "python_rapidjson-1.16-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:743889afdae0b8e8432a72323f643a867299b3d1a96927f71dccb198662034d6"}, - {file = "python_rapidjson-1.16-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:97f757ae43a20068d4dfecf50462f5bc3490667ce22b5c16bbad7930bc6b1fe8"}, - {file = "python_rapidjson-1.16-cp311-cp311-win32.whl", hash = "sha256:f5b0830e3b0e556636b5d56452b25e926b273aeb828a77f8ab3118bba6daddba"}, - {file = "python_rapidjson-1.16-cp311-cp311-win_amd64.whl", hash = "sha256:dcc73c7784bccee3ad79697d20c20067c154561552aaa0e90159d3cd7488e77d"}, - {file = "python_rapidjson-1.16-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:3a06cef553e1b2e8f7b1a8bb5ceeb7f5d5a8f7f406c65a3ff84b3f97c297e19f"}, - {file = "python_rapidjson-1.16-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d861628bd257a595ef87256c15f16d58ffc9be4f555df582f3e0ed429f8bcb3"}, - {file = "python_rapidjson-1.16-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:483de28d2f9d1c42f79df1673d5fe23d3bd349aaec1f90bbcbe8a39511d03e20"}, - {file = "python_rapidjson-1.16-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d8ebc242ec652ea503201bf7c3429e03e7268f43ddaa1b6ee96b479a4f6f64eb"}, - {file = "python_rapidjson-1.16-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f9652d4dfc55efb3df14c0034671edd8756c8f865e05e9176d5bb9ba040fe7b"}, - {file = "python_rapidjson-1.16-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6144c0765f946afec74b2bfde53c0a412813c346cdfea6b9ebb63ed4511dac2e"}, - {file = "python_rapidjson-1.16-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:23333fbd3f56623e8c99747aea2130981c6476e017563af7bc8ece8dcc23fbfc"}, - {file = "python_rapidjson-1.16-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:ac96a6e3fe7b34a544e85b9d258569be2e9bee4a5dfb5c047718f7e76fa92016"}, - {file = "python_rapidjson-1.16-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:909fde38da88cbd32a6e451fdbe83be12137bc5f8e46129214426fc3e859acf2"}, - {file = "python_rapidjson-1.16-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:a4a9d05185f157ea33718ee799d0fad7afbd8d49153d61ed17d065a2f8683ca0"}, - {file = "python_rapidjson-1.16-cp312-cp312-win32.whl", hash = "sha256:f86e405cbb7e778c2992dbddc3ed4ea562b9a4109feef7831ff06ce838378ffa"}, - {file = "python_rapidjson-1.16-cp312-cp312-win_amd64.whl", hash = "sha256:902f3ee2db0ccc028b0e44b82aa8da59a8c88811a6223a06e97b73ed8adaa6f3"}, - {file = "python_rapidjson-1.16-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:e8939f66d64f2abefa288dab0ffd99a948191f255fb5e64197e0ef7b840bf774"}, - {file = "python_rapidjson-1.16-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:a4351720b2424fb58ab5eaab16910bb3649f78265b12cb15c09880ca501b7513"}, - {file = "python_rapidjson-1.16-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eb2e9bca595b53489f16a130bfc70c0600eb9a76d5b0eb18990a65d1f6bd7583"}, - {file = "python_rapidjson-1.16-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8e0cf57ab8acb7ca60130c79c18cfcd6f1ce219a14fdff2b0840a847d879d1f5"}, - {file = "python_rapidjson-1.16-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ece8b2df2bc8a614f6e0d6107fddb5d1bdc88e19505c83286548e27090ec248d"}, - {file = "python_rapidjson-1.16-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:67f56857c4b60d67941cc0816e1159290055b390f5df0d07fa227981412ac89d"}, - {file = "python_rapidjson-1.16-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:210b6b6a74415111b3d54ca290eb3c25d9733a0fa5a3d795506520633db2f23c"}, - {file = "python_rapidjson-1.16-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:aba4087bad2aaf14bf3b60b31dbdab311fe82ddb01fe55bff30b366df05a7d86"}, - {file = "python_rapidjson-1.16-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:ef5ca9fa2d4437bf0165a20ef5d2dd3582aaef038f43ed663e629f3fa27e6800"}, - {file = "python_rapidjson-1.16-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:5b7c34cf1fb7be3a2662c499f1da4bedf35d6dad44dd537b5833555c8c118af9"}, - {file = "python_rapidjson-1.16-cp38-cp38-win32.whl", hash = "sha256:e75316f4c80cd3a08cb241c10a704701628c9675b271782867e58fcfab47a6fe"}, - {file = "python_rapidjson-1.16-cp38-cp38-win_amd64.whl", hash = "sha256:9c642bc6e78b7eec357f32292b5091d59ab36976af669455d3eb5345510ea6eb"}, - {file = "python_rapidjson-1.16-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9aa62070a0a3d1a6b1e72c522823d0e99498ec5357610a7d7a6df5735ec37e6c"}, - {file = "python_rapidjson-1.16-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fc45c7ce9a2f692181f0c5a50dd9167ce9f58e04265ba5db4e47e0c9019957b0"}, - {file = "python_rapidjson-1.16-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e982bbde9a573097d0440e7d8c256dc03a68bb923bc75fa104c84dbba2dc03a5"}, - {file = "python_rapidjson-1.16-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bd98c03b2a798956f9c6c81dfe579285f54b685c89b90fd0a26814b84c6a530b"}, - {file = "python_rapidjson-1.16-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:48d9a7b4ad83b6a9be4a577d5b31283e6b132d5d320ea52733ff24ede78a4e15"}, - {file = "python_rapidjson-1.16-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:bc3d6e22113d69f734677dcccb33652d318f5e0b88e9cf5dc252c72e68921a7b"}, - {file = "python_rapidjson-1.16-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:71b2cc48217b9e5f3b5e1a1d4b109709c8f3a47e76ae73103739ef63c6d9da27"}, - {file = "python_rapidjson-1.16-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:b0c138a9efc2ee4f0267d19ed4cabeeb018bb256ba6ff30368d5d13098a42da6"}, - {file = "python_rapidjson-1.16-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:05c86c585b3084564ec4b0e490f06de928eaedd26b408b713a226a6d96916c94"}, - {file = "python_rapidjson-1.16-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:476cb179949feba4abc76f94c80bc82232690ca19a911868422fde7f6ebc8588"}, - {file = "python_rapidjson-1.16-cp39-cp39-win32.whl", hash = "sha256:fc5647a1c6a91998e758349fefe31b81d462acfbddfa7d74cf8320411978a178"}, - {file = "python_rapidjson-1.16-cp39-cp39-win_amd64.whl", hash = "sha256:b00f0c822532842834315a6d5e5e2567282dd64586139e99b63eedb5d14a15ae"}, + {file = "python-rapidjson-1.17.tar.gz", hash = "sha256:95a111da29d996af8549f8b32ec701dab3af2ab7c6cd9c79540391ecb05f20c8"}, + {file = "python_rapidjson-1.17-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:87d3d12c3d7436a7b43780b190d3e659d59c44b80d54c175c2837b399c4e7db9"}, + {file = "python_rapidjson-1.17-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac66ea04b450e8a9914a7de410a1d01a1011c11d5e72a3296a7d14e2636e3bd5"}, + {file = "python_rapidjson-1.17-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:41747cf6284c7fa578bcc32e406b65351b084f4cb8d89d6bf631e5a86fd2fb92"}, + {file = "python_rapidjson-1.17-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f942d0b73c9addef42683aa17a77f61075816592b799b825aa72573d073b3603"}, + {file = "python_rapidjson-1.17-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c666f88c3d20a420a96561659a9cd38e79735d7dfbe603dfc612b545cd082f47"}, + {file = "python_rapidjson-1.17-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:92766b71d8398dc132ad5b54654045dc05c1fb92ba674d83bdc694e476f67388"}, + {file = "python_rapidjson-1.17-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:fde021615cb4fce0415ce9c168024b4801bac881084a72c6d8ae65fd1eb4b8e8"}, + {file = "python_rapidjson-1.17-cp310-cp310-musllinux_1_2_i686.whl", hash = "sha256:a0d1356c2816d31d3c8798363a9c92479e7aa1c9344d4cb48b7e396cd1dbe7dc"}, + {file = "python_rapidjson-1.17-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:67d4645604f7ab95437d8a1fdd616c17e7100414224f139364a8a7b3b875a524"}, + {file = "python_rapidjson-1.17-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:ee814bea835a9e8578f4bddc05cd55f92a54cad57d78fb00778d2d177bfd4862"}, + {file = "python_rapidjson-1.17-cp310-cp310-win32.whl", hash = "sha256:29ff7c77eda1e95d5422a6778ff37e0a43ab769c7ff1e62e102557fafe729203"}, + {file = "python_rapidjson-1.17-cp310-cp310-win_amd64.whl", hash = "sha256:2a947d825d1c4789f9b376fd3b602a037e3020546bfb8648a8128d94394a7fe0"}, + {file = "python_rapidjson-1.17-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:8cb8b38b4b4150082f9c97c65d5bb8b2dd748e1e9c05429247d629406385222b"}, + {file = "python_rapidjson-1.17-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:2ef881461db16a7e09273b8a3ea36777a0ac8405d5eec507c365f408dd657a22"}, + {file = "python_rapidjson-1.17-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:701a301c540a911485a326857a7c16f8d048722bcd0cc2e1db2aa7008f35cfe3"}, + {file = "python_rapidjson-1.17-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c0a4364238b2a193814073da7f825688cbf1cc77f9949452aaee5452c8f9e6f0"}, + {file = "python_rapidjson-1.17-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e45146f8549a34d22e992eef1bde42e074ee24dfe0f5d2df5a74bb9632150765"}, + {file = "python_rapidjson-1.17-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:66e3b40012e22dd17d4390f3674320f461baba00f09666b8cc55d35a7860c382"}, + {file = "python_rapidjson-1.17-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:be466029d473e23a9c3379c982b1350f411d783549e301495eb794b7f53a408d"}, + {file = "python_rapidjson-1.17-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:f2fffa772a880897b9848b99ccd5e75aba82bffe50c898d6f611ae36b1c0cb78"}, + {file = "python_rapidjson-1.17-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:df1ea407c57e607913c4c85d03cdc172b5cf742b87d6f8b13b54fc5163ffd804"}, + {file = "python_rapidjson-1.17-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:1f6e91cb384189a0b74c5795448e0959ac84262d3c83815dc80f3749ab8812f5"}, + {file = "python_rapidjson-1.17-cp311-cp311-win32.whl", hash = "sha256:e7c5a7c434f2ad928c3d51651f991204b9948fa495f585014fcdc413c353ec19"}, + {file = "python_rapidjson-1.17-cp311-cp311-win_amd64.whl", hash = "sha256:14a57e8a13a9c92cef060766f76fe729af84b56450b32252786e864a3f2fed16"}, + {file = "python_rapidjson-1.17-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d375bcc524a48078c791419343487e45c8a92c8c813229be8e12fb02c8902722"}, + {file = "python_rapidjson-1.17-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:511a252122b61f9767c695a981753e45ca078cc4555a044d62eaf0fe6c6ef034"}, + {file = "python_rapidjson-1.17-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cf25006fc6752c0aafe5c3bdb9ff878531efd8a6aa3ac3e438d143ba2cc2b19"}, + {file = "python_rapidjson-1.17-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2dc8701780f69493c1e57ac3c5ace8d36d84e01d06d5d03459b673afbf311b52"}, + {file = "python_rapidjson-1.17-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:27e9c3d503eb43c6d899c2947148bde272fb04ba343226d98a34011c077edd35"}, + {file = "python_rapidjson-1.17-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:efa33a296a103cc86dc187bde8eee7c416ca53fe904a68ad7cf75c7713ffa357"}, + {file = "python_rapidjson-1.17-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c72db2de40106486fb39eef565b65cd783a7a4a8020b8c15f3a34b23323e0e1f"}, + {file = "python_rapidjson-1.17-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:849c74af38a049a6590b113256351e2b7143c586fd3024893c13fc5f48e6f961"}, + {file = "python_rapidjson-1.17-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:70a4dcf2befaebd83d2df551c1c7162ac8d150e0065e94ac486907f7f05bd1b0"}, + {file = "python_rapidjson-1.17-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b2f2ec6b960bc7b523e9a126da7c923c4a911d793f5942231adcc7b121ce4a05"}, + {file = "python_rapidjson-1.17-cp312-cp312-win32.whl", hash = "sha256:2387690306a07afd9b2702ce90d5656d095caf49bbac726df38c586401df0606"}, + {file = "python_rapidjson-1.17-cp312-cp312-win_amd64.whl", hash = "sha256:3e0ec69dad3cd0b0abdcc10865630ebcc016669a05b03aa79d25f596d1b22c44"}, + {file = "python_rapidjson-1.17-cp313-cp313-macosx_10_9_x86_64.whl", hash = "sha256:fcf6b200eab700009a9d6eff961c58a6402eb729c9850a2e07da1437ba7a7a83"}, + {file = "python_rapidjson-1.17-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:5e5e9070c38fc2c9700df85d97c9cf2731fd704531f42ed7bcedd1d46748d574"}, + {file = "python_rapidjson-1.17-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35fabf61d3c7f78b9dd852732576ab870bcb2d1caae7834d3622ef6fabfb4f1e"}, + {file = "python_rapidjson-1.17-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:bd5792883dbc715616ee4173ffe48ede4a824ecc58a9f31109afeec331b6830d"}, + {file = "python_rapidjson-1.17-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44532140a00217f3949344136a3875903eaf7598a3671ad840aa001104639b42"}, + {file = "python_rapidjson-1.17-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9aeda5f79ebc32cc38ec53af17b85d40c2c0330effa60ea564fc3f22b6ecfbc5"}, + {file = "python_rapidjson-1.17-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:e214c8aeae862b529b304f96ffe91b93efb57e919f11c3cb875b02b0855f76e3"}, + {file = "python_rapidjson-1.17-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:3f8bd5dc3a797450b84dfbc155553472d949ff721d16bde4bdf026758c88b260"}, + {file = "python_rapidjson-1.17-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:2ae0a20d269b6207b225029952f6cbcc45d6fceba8f03e5035e5a5f3e7924e44"}, + {file = "python_rapidjson-1.17-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:04bb97218061748ee4b630587c7ed668d65868a04c357b1069c1d7200c33da3e"}, + {file = "python_rapidjson-1.17-cp313-cp313-win32.whl", hash = "sha256:a5e8779e1a53838957d6c185c6c6bb19578008c9bb48f2a735834cc538e26f1f"}, + {file = "python_rapidjson-1.17-cp313-cp313-win_amd64.whl", hash = "sha256:2582d26621af8fe0e8dac8d739c2758d15aeae44958fbcf3b3120536c45b5a31"}, + {file = "python_rapidjson-1.17-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b3110fefbf8ec4c5c66859ba3576040a44a1ff475db5034d34d6582e4762e4ce"}, + {file = "python_rapidjson-1.17-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:7b9f6aa56f24f8b527a18f2e4ab45946983d488f9eec83193432417b91086bb6"}, + {file = "python_rapidjson-1.17-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:efa5f656addd3ccac264997f6e6c8fabd1555617248c47cd04d542f5b9a1a527"}, + {file = "python_rapidjson-1.17-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:be4d2b47368af3b206d6c88bfd492e6cda6b4053b6900938bd2c2d81c007fc22"}, + {file = "python_rapidjson-1.17-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d35662a224d2213d3078e8411aeb58f0d96eef9df7863b4fba62d7d665b73232"}, + {file = "python_rapidjson-1.17-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e4b859d8eef65550cb191769bed4f6aed94fdf6262337c39695a3270e766e1d9"}, + {file = "python_rapidjson-1.17-cp38-cp38-musllinux_1_2_aarch64.whl", hash = "sha256:b98bcfcd81ca56adde1e80612378bf74dd46332f2f283c65dfee3f25ee149f3d"}, + {file = "python_rapidjson-1.17-cp38-cp38-musllinux_1_2_i686.whl", hash = "sha256:596189aa0462c42f5024f9aea5fffef5ca8c64e8eaff2436f0ec192a7ca6d902"}, + {file = "python_rapidjson-1.17-cp38-cp38-musllinux_1_2_ppc64le.whl", hash = "sha256:84209abefba673f4f227a41c1d509e026a4dd68342495127bb0c6c1fe4e39107"}, + {file = "python_rapidjson-1.17-cp38-cp38-musllinux_1_2_x86_64.whl", hash = "sha256:6104a0c6d8ae6fb1aa06bd528829371ea93143f40c09ba38a90835808103c62b"}, + {file = "python_rapidjson-1.17-cp38-cp38-win32.whl", hash = "sha256:77c9d9632010ab9c0d8f94da281cce6a5729c9d43b12a77b8ab0ef537df4b3f9"}, + {file = "python_rapidjson-1.17-cp38-cp38-win_amd64.whl", hash = "sha256:e87fb60381d2df441aa60b3dac77df20f6044ed4fcfd92021cb139bf7280894c"}, + {file = "python_rapidjson-1.17-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c59e5ab360b5765387607ec1b08c8a97a04e56fa73d3538775a81f2250a3d055"}, + {file = "python_rapidjson-1.17-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fb7015de6d08d7cc37485e031ae7b99377971dd1b4ebcc8027d71b8094cb5921"}, + {file = "python_rapidjson-1.17-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c4b6fc4b185c5096092ca4a595bf272d3eb77c557c9c194cd5d5b1d677e164c7"}, + {file = "python_rapidjson-1.17-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fa32abeeeae7d1559f4a17d4c009f6f42c9dd90275a6bc8febc59c21cf6e0ef8"}, + {file = "python_rapidjson-1.17-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e101a79b606ae9f89c6d15ffb32b61481b1e6188591821bef18380c813fa921b"}, + {file = "python_rapidjson-1.17-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2531ff943ad7ccc3381dbf54b453a9f6a479caac7c7c47678322cac0253bf045"}, + {file = "python_rapidjson-1.17-cp39-cp39-musllinux_1_2_aarch64.whl", hash = "sha256:328a052da424d7f0a4986160df623eb7d189c0b5e1bf533ec0e50cc85642aa71"}, + {file = "python_rapidjson-1.17-cp39-cp39-musllinux_1_2_i686.whl", hash = "sha256:958ecbd226da221059ca3a9a0320d88ac11980bfaac222ab7254a6c4673bfd46"}, + {file = "python_rapidjson-1.17-cp39-cp39-musllinux_1_2_ppc64le.whl", hash = "sha256:0e3dd0361d1f0594617092b303754b43a4b9d75d47b16eb3282aa97c3eab44f7"}, + {file = "python_rapidjson-1.17-cp39-cp39-musllinux_1_2_x86_64.whl", hash = "sha256:6f910c7284a38becf30896fef7a59c88c840379d4f082d7283b065a2b398f641"}, + {file = "python_rapidjson-1.17-cp39-cp39-win32.whl", hash = "sha256:3f686eb5d68b2775f60641a1c07c3329db7e7b3a6e5c1a7d4907078699c8396f"}, + {file = "python_rapidjson-1.17-cp39-cp39-win_amd64.whl", hash = "sha256:df64031b785dee4b72d3cd8ce4cfcef46982d6c580182b0086d7ebc038be3b63"}, ] [[package]] @@ -3918,99 +4015,99 @@ files = [ [[package]] name = "pyzmq" -version = "26.0.2" +version = "26.0.3" description = "Python bindings for 0MQ" optional = false python-versions = ">=3.7" files = [ - {file = "pyzmq-26.0.2-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:1a60a03b01e8c9c58932ec0cca15b1712d911c2800eb82d4281bc1ae5b6dad50"}, - {file = "pyzmq-26.0.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:949067079e14ea1973bd740255e0840118c163d4bce8837f539d749f145cf5c3"}, - {file = "pyzmq-26.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:37e7edfa6cf96d036a403775c96afa25058d1bb940a79786a9a2fc94a783abe3"}, - {file = "pyzmq-26.0.2-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:903cc7a84a7d4326b43755c368780800e035aa3d711deae84a533fdffa8755b0"}, - {file = "pyzmq-26.0.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6cb2e41af165e5f327d06fbdd79a42a4e930267fade4e9f92d17f3ccce03f3a7"}, - {file = "pyzmq-26.0.2-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:55353b8189adcfc4c125fc4ce59d477744118e9c0ec379dd0999c5fa120ac4f5"}, - {file = "pyzmq-26.0.2-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:f961423ff6236a752ced80057a20e623044df95924ed1009f844cde8b3a595f9"}, - {file = "pyzmq-26.0.2-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:ba77fe84fe4f5f3dc0ef681a6d366685c8ffe1c8439c1d7530997b05ac06a04b"}, - {file = "pyzmq-26.0.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:52589f0a745ef61b9c75c872cf91f8c1f7c0668eb3dd99d7abd639d8c0fb9ca7"}, - {file = "pyzmq-26.0.2-cp310-cp310-win32.whl", hash = "sha256:b7b6d2a46c7afe2ad03ec8faf9967090c8ceae85c4d8934d17d7cae6f9062b64"}, - {file = "pyzmq-26.0.2-cp310-cp310-win_amd64.whl", hash = "sha256:86531e20de249d9204cc6d8b13d5a30537748c78820215161d8a3b9ea58ca111"}, - {file = "pyzmq-26.0.2-cp310-cp310-win_arm64.whl", hash = "sha256:f26a05029ecd2bd306b941ff8cb80f7620b7901421052bc429d238305b1cbf2f"}, - {file = "pyzmq-26.0.2-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:70770e296a9cb03d955540c99360aab861cbb3cba29516abbd106a15dbd91268"}, - {file = "pyzmq-26.0.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2740fd7161b39e178554ebf21aa5667a1c9ef0cd2cb74298fd4ef017dae7aec4"}, - {file = "pyzmq-26.0.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f5e3706c32dea077faa42b1c92d825b7f86c866f72532d342e0be5e64d14d858"}, - {file = "pyzmq-26.0.2-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0fa1416876194927f7723d6b7171b95e1115602967fc6bfccbc0d2d51d8ebae1"}, - {file = "pyzmq-26.0.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ef9a79a48794099c57dc2df00340b5d47c5caa1792f9ddb8c7a26b1280bd575"}, - {file = "pyzmq-26.0.2-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:1c60fcdfa3229aeee4291c5d60faed3a813b18bdadb86299c4bf49e8e51e8605"}, - {file = "pyzmq-26.0.2-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e943c39c206b04df2eb5d71305761d7c3ca75fd49452115ea92db1b5b98dbdef"}, - {file = "pyzmq-26.0.2-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:8da0ed8a598693731c76659880a668f4748b59158f26ed283a93f7f04d47447e"}, - {file = "pyzmq-26.0.2-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:7bf51970b11d67096bede97cdbad0f4333f7664f4708b9b2acb352bf4faa3140"}, - {file = "pyzmq-26.0.2-cp311-cp311-win32.whl", hash = "sha256:6f8e6bd5d066be605faa9fe5ec10aa1a46ad9f18fc8646f2b9aaefc8fb575742"}, - {file = "pyzmq-26.0.2-cp311-cp311-win_amd64.whl", hash = "sha256:6d03da3a0ae691b361edcb39530075461202f699ce05adbb15055a0e1c9bcaa4"}, - {file = "pyzmq-26.0.2-cp311-cp311-win_arm64.whl", hash = "sha256:f84e33321b68ff00b60e9dbd1a483e31ab6022c577c8de525b8e771bd274ce68"}, - {file = "pyzmq-26.0.2-cp312-cp312-macosx_10_15_universal2.whl", hash = "sha256:44c33ebd1c62a01db7fbc24e18bdda569d6639217d13d5929e986a2b0f69070d"}, - {file = "pyzmq-26.0.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:ac04f904b4fce4afea9cdccbb78e24d468cb610a839d5a698853e14e2a3f9ecf"}, - {file = "pyzmq-26.0.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f2133de5ba9adc5f481884ccb699eac9ce789708292945c05746880f95b241c0"}, - {file = "pyzmq-26.0.2-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7753c67c570d7fc80c2dc59b90ca1196f1224e0e2e29a548980c95fe0fe27fc1"}, - {file = "pyzmq-26.0.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8d4e51632e6b12e65e8d9d7612446ecda2eda637a868afa7bce16270194650dd"}, - {file = "pyzmq-26.0.2-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:d6c38806f6ecd0acf3104b8d7e76a206bcf56dadd6ce03720d2fa9d9157d5718"}, - {file = "pyzmq-26.0.2-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:48f496bbe14686b51cec15406323ae6942851e14022efd7fc0e2ecd092c5982c"}, - {file = "pyzmq-26.0.2-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e84a3161149c75bb7a7dc8646384186c34033e286a67fec1ad1bdedea165e7f4"}, - {file = "pyzmq-26.0.2-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:dabf796c67aa9f5a4fcc956d47f0d48b5c1ed288d628cf53aa1cf08e88654343"}, - {file = "pyzmq-26.0.2-cp312-cp312-win32.whl", hash = "sha256:3eee4c676af1b109f708d80ef0cf57ecb8aaa5900d1edaf90406aea7e0e20e37"}, - {file = "pyzmq-26.0.2-cp312-cp312-win_amd64.whl", hash = "sha256:26721fec65846b3e4450dad050d67d31b017f97e67f7e0647b5f98aa47f828cf"}, - {file = "pyzmq-26.0.2-cp312-cp312-win_arm64.whl", hash = "sha256:653955c6c233e90de128a1b8e882abc7216f41f44218056bd519969c8c413a15"}, - {file = "pyzmq-26.0.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:becd8d8fb068fbb5a52096efd83a2d8e54354383f691781f53a4c26aee944542"}, - {file = "pyzmq-26.0.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:7a15e5465e7083c12517209c9dd24722b25e9b63c49a563922922fc03554eb35"}, - {file = "pyzmq-26.0.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e8158ac8616941f874841f9fa0f6d2f1466178c2ff91ea08353fdc19de0d40c2"}, - {file = "pyzmq-26.0.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ea2c6a53e28c7066ea7db86fcc0b71d78d01b818bb11d4a4341ec35059885295"}, - {file = "pyzmq-26.0.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:bdbc7dab0b0e9c62c97b732899c4242e3282ba803bad668e03650b59b165466e"}, - {file = "pyzmq-26.0.2-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:e74b6d5ef57bb65bf1b4a37453d8d86d88550dde3fb0f23b1f1a24e60c70af5b"}, - {file = "pyzmq-26.0.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ed4c6ee624ecbc77b18aeeb07bf0700d26571ab95b8f723f0d02e056b5bce438"}, - {file = "pyzmq-26.0.2-cp37-cp37m-win32.whl", hash = "sha256:8a98b3cb0484b83c19d8fb5524c8a469cd9f10e743f5904ac285d92678ee761f"}, - {file = "pyzmq-26.0.2-cp37-cp37m-win_amd64.whl", hash = "sha256:aa5f95d71b6eca9cec28aa0a2f8310ea53dea313b63db74932879ff860c1fb8d"}, - {file = "pyzmq-26.0.2-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:5ff56c76ce77b9805378a7a73032c17cbdb1a5b84faa1df03c5d3e306e5616df"}, - {file = "pyzmq-26.0.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bab697fc1574fee4b81da955678708567c43c813c84c91074e452bda5346c921"}, - {file = "pyzmq-26.0.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0c0fed8aa9ba0488ee1cbdaa304deea92d52fab43d373297002cfcc69c0a20c5"}, - {file = "pyzmq-26.0.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:606b922699fcec472ed814dda4dc3ff7c748254e0b26762a0ba21a726eb1c107"}, - {file = "pyzmq-26.0.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45f0fd82bad4d199fa993fbf0ac586a7ac5879addbe436a35a389df7e0eb4c91"}, - {file = "pyzmq-26.0.2-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:166c5e41045939a52c01e6f374e493d9a6a45dfe677360d3e7026e38c42e8906"}, - {file = "pyzmq-26.0.2-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d566e859e8b8d5bca08467c093061774924b3d78a5ba290e82735b2569edc84b"}, - {file = "pyzmq-26.0.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:264ee0e72b72ca59279dc320deab5ae0fac0d97881aed1875ce4bde2e56ffde0"}, - {file = "pyzmq-26.0.2-cp38-cp38-win32.whl", hash = "sha256:3152bbd3a4744cbdd83dfb210ed701838b8b0c9065cef14671d6d91df12197d0"}, - {file = "pyzmq-26.0.2-cp38-cp38-win_amd64.whl", hash = "sha256:bf77601d75ca692c179154b7e5943c286a4aaffec02c491afe05e60493ce95f2"}, - {file = "pyzmq-26.0.2-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:c770a7545b3deca2db185b59175e710a820dd4ed43619f4c02e90b0e227c6252"}, - {file = "pyzmq-26.0.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d47175f0a380bfd051726bc5c0054036ae4a5d8caf922c62c8a172ccd95c1a2a"}, - {file = "pyzmq-26.0.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:9bce298c1ce077837e110367c321285dc4246b531cde1abfc27e4a5bbe2bed4d"}, - {file = "pyzmq-26.0.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c40b09b7e184d6e3e1be1c8af2cc320c0f9f610d8a5df3dd866e6e6e4e32b235"}, - {file = "pyzmq-26.0.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d420d856bf728713874cefb911398efe69e1577835851dd297a308a78c14c249"}, - {file = "pyzmq-26.0.2-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:d792d3cab987058451e55c70c5926e93e2ceb68ca5a2334863bb903eb860c9cb"}, - {file = "pyzmq-26.0.2-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:83ec17729cf6d3464dab98a11e98294fcd50e6b17eaabd3d841515c23f6dbd3a"}, - {file = "pyzmq-26.0.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:47c17d5ebfa88ae90f08960c97b49917098665b8cd8be31f2c24e177bcf37a0f"}, - {file = "pyzmq-26.0.2-cp39-cp39-win32.whl", hash = "sha256:d509685d1cd1d018705a811c5f9d5bc237790936ead6d06f6558b77e16cc7235"}, - {file = "pyzmq-26.0.2-cp39-cp39-win_amd64.whl", hash = "sha256:c7cc8cc009e8f6989a6d86c96f87dae5f5fb07d6c96916cdc7719d546152c7db"}, - {file = "pyzmq-26.0.2-cp39-cp39-win_arm64.whl", hash = "sha256:3ada31cb879cd7532f4a85b501f4255c747d4813ab76b35c49ed510ce4865b45"}, - {file = "pyzmq-26.0.2-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:0a6ceaddc830dd3ca86cb8451cf373d1f05215368e11834538c2902ed5205139"}, - {file = "pyzmq-26.0.2-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6a967681463aa7a99eb9a62bb18229b653b45c10ff0947b31cc0837a83dfb86f"}, - {file = "pyzmq-26.0.2-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6472a73bc115bc40a2076609a90894775abe6faf19a78375675a2f889a613071"}, - {file = "pyzmq-26.0.2-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5d6aea92bcccfe5e5524d3c70a6f16ffdae548390ddad26f4207d55c55a40593"}, - {file = "pyzmq-26.0.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:e025f6351e49d48a5aa2f5a09293aa769b0ee7369c25bed551647234b7fa0c75"}, - {file = "pyzmq-26.0.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:40bd7ebe4dbb37d27f0c56e2a844f360239343a99be422085e13e97da13f73f9"}, - {file = "pyzmq-26.0.2-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:1dd40d586ad6f53764104df6e01810fe1b4e88fd353774629a5e6fe253813f79"}, - {file = "pyzmq-26.0.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:f2aca15e9ad8c8657b5b3d7ae3d1724dc8c1c1059c06b4b674c3aa36305f4930"}, - {file = "pyzmq-26.0.2-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:450ec234736732eb0ebeffdb95a352450d4592f12c3e087e2a9183386d22c8bf"}, - {file = "pyzmq-26.0.2-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:f43be2bebbd09360a2f23af83b243dc25ffe7b583ea8c722e6df03e03a55f02f"}, - {file = "pyzmq-26.0.2-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:867f55e54aff254940bcec5eec068e7c0ac1e6bf360ab91479394a8bf356b0e6"}, - {file = "pyzmq-26.0.2-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:b4dbc033c5ad46f8c429bf238c25a889b8c1d86bfe23a74e1031a991cb3f0000"}, - {file = "pyzmq-26.0.2-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6e8dd2961462e337e21092ec2da0c69d814dcb1b6e892955a37444a425e9cfb8"}, - {file = "pyzmq-26.0.2-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:35391e72df6c14a09b697c7b94384947c1dd326aca883ff98ff137acdf586c33"}, - {file = "pyzmq-26.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:1c3d3c92fa54eda94ab369ca5b8d35059987c326ba5e55326eb068862f64b1fc"}, - {file = "pyzmq-26.0.2-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:e7aa61a9cc4f0523373e31fc9255bf4567185a099f85ca3598e64de484da3ab2"}, - {file = "pyzmq-26.0.2-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ee53a8191271f144cc20b12c19daa9f1546adc84a2f33839e3338039b55c373c"}, - {file = "pyzmq-26.0.2-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ac60a980f07fa988983f7bfe6404ef3f1e4303f5288a01713bc1266df6d18783"}, - {file = "pyzmq-26.0.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:88896b1b4817d7b2fe1ec7205c4bbe07bf5d92fb249bf2d226ddea8761996068"}, - {file = "pyzmq-26.0.2-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:18dfffe23751edee917764ffa133d5d3fef28dfd1cf3adebef8c90bc854c74c4"}, - {file = "pyzmq-26.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:6926dd14cfe6967d3322640b6d5c3c3039db71716a5e43cca6e3b474e73e0b36"}, - {file = "pyzmq-26.0.2.tar.gz", hash = "sha256:f0f9bb370449158359bb72a3e12c658327670c0ffe6fbcd1af083152b64f9df0"}, + {file = "pyzmq-26.0.3-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:44dd6fc3034f1eaa72ece33588867df9e006a7303725a12d64c3dff92330f625"}, + {file = "pyzmq-26.0.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:acb704195a71ac5ea5ecf2811c9ee19ecdc62b91878528302dd0be1b9451cc90"}, + {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5dbb9c997932473a27afa93954bb77a9f9b786b4ccf718d903f35da3232317de"}, + {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6bcb34f869d431799c3ee7d516554797f7760cb2198ecaa89c3f176f72d062be"}, + {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:38ece17ec5f20d7d9b442e5174ae9f020365d01ba7c112205a4d59cf19dc38ee"}, + {file = "pyzmq-26.0.3-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:ba6e5e6588e49139a0979d03a7deb9c734bde647b9a8808f26acf9c547cab1bf"}, + {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:3bf8b000a4e2967e6dfdd8656cd0757d18c7e5ce3d16339e550bd462f4857e59"}, + {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2136f64fbb86451dbbf70223635a468272dd20075f988a102bf8a3f194a411dc"}, + {file = "pyzmq-26.0.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e8918973fbd34e7814f59143c5f600ecd38b8038161239fd1a3d33d5817a38b8"}, + {file = "pyzmq-26.0.3-cp310-cp310-win32.whl", hash = "sha256:0aaf982e68a7ac284377d051c742610220fd06d330dcd4c4dbb4cdd77c22a537"}, + {file = "pyzmq-26.0.3-cp310-cp310-win_amd64.whl", hash = "sha256:f1a9b7d00fdf60b4039f4455afd031fe85ee8305b019334b72dcf73c567edc47"}, + {file = "pyzmq-26.0.3-cp310-cp310-win_arm64.whl", hash = "sha256:80b12f25d805a919d53efc0a5ad7c0c0326f13b4eae981a5d7b7cc343318ebb7"}, + {file = "pyzmq-26.0.3-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:a72a84570f84c374b4c287183debc776dc319d3e8ce6b6a0041ce2e400de3f32"}, + {file = "pyzmq-26.0.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7ca684ee649b55fd8f378127ac8462fb6c85f251c2fb027eb3c887e8ee347bcd"}, + {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e222562dc0f38571c8b1ffdae9d7adb866363134299264a1958d077800b193b7"}, + {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f17cde1db0754c35a91ac00b22b25c11da6eec5746431d6e5092f0cd31a3fea9"}, + {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b7c0c0b3244bb2275abe255d4a30c050d541c6cb18b870975553f1fb6f37527"}, + {file = "pyzmq-26.0.3-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:ac97a21de3712afe6a6c071abfad40a6224fd14fa6ff0ff8d0c6e6cd4e2f807a"}, + {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:88b88282e55fa39dd556d7fc04160bcf39dea015f78e0cecec8ff4f06c1fc2b5"}, + {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:72b67f966b57dbd18dcc7efbc1c7fc9f5f983e572db1877081f075004614fcdd"}, + {file = "pyzmq-26.0.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f4b6cecbbf3b7380f3b61de3a7b93cb721125dc125c854c14ddc91225ba52f83"}, + {file = "pyzmq-26.0.3-cp311-cp311-win32.whl", hash = "sha256:eed56b6a39216d31ff8cd2f1d048b5bf1700e4b32a01b14379c3b6dde9ce3aa3"}, + {file = "pyzmq-26.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:3191d312c73e3cfd0f0afdf51df8405aafeb0bad71e7ed8f68b24b63c4f36500"}, + {file = "pyzmq-26.0.3-cp311-cp311-win_arm64.whl", hash = "sha256:b6907da3017ef55139cf0e417c5123a84c7332520e73a6902ff1f79046cd3b94"}, + {file = "pyzmq-26.0.3-cp312-cp312-macosx_10_15_universal2.whl", hash = "sha256:068ca17214038ae986d68f4a7021f97e187ed278ab6dccb79f837d765a54d753"}, + {file = "pyzmq-26.0.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:7821d44fe07335bea256b9f1f41474a642ca55fa671dfd9f00af8d68a920c2d4"}, + {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eeb438a26d87c123bb318e5f2b3d86a36060b01f22fbdffd8cf247d52f7c9a2b"}, + {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:69ea9d6d9baa25a4dc9cef5e2b77b8537827b122214f210dd925132e34ae9b12"}, + {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7daa3e1369355766dea11f1d8ef829905c3b9da886ea3152788dc25ee6079e02"}, + {file = "pyzmq-26.0.3-cp312-cp312-manylinux_2_28_x86_64.whl", hash = "sha256:6ca7a9a06b52d0e38ccf6bca1aeff7be178917893f3883f37b75589d42c4ac20"}, + {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:1b7d0e124948daa4d9686d421ef5087c0516bc6179fdcf8828b8444f8e461a77"}, + {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:e746524418b70f38550f2190eeee834db8850088c834d4c8406fbb9bc1ae10b2"}, + {file = "pyzmq-26.0.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:6b3146f9ae6af82c47a5282ac8803523d381b3b21caeae0327ed2f7ecb718798"}, + {file = "pyzmq-26.0.3-cp312-cp312-win32.whl", hash = "sha256:2b291d1230845871c00c8462c50565a9cd6026fe1228e77ca934470bb7d70ea0"}, + {file = "pyzmq-26.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:926838a535c2c1ea21c903f909a9a54e675c2126728c21381a94ddf37c3cbddf"}, + {file = "pyzmq-26.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:5bf6c237f8c681dfb91b17f8435b2735951f0d1fad10cc5dfd96db110243370b"}, + {file = "pyzmq-26.0.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0c0991f5a96a8e620f7691e61178cd8f457b49e17b7d9cfa2067e2a0a89fc1d5"}, + {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:dbf012d8fcb9f2cf0643b65df3b355fdd74fc0035d70bb5c845e9e30a3a4654b"}, + {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:01fbfbeb8249a68d257f601deb50c70c929dc2dfe683b754659569e502fbd3aa"}, + {file = "pyzmq-26.0.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1c8eb19abe87029c18f226d42b8a2c9efdd139d08f8bf6e085dd9075446db450"}, + {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:5344b896e79800af86ad643408ca9aa303a017f6ebff8cee5a3163c1e9aec987"}, + {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:204e0f176fd1d067671157d049466869b3ae1fc51e354708b0dc41cf94e23a3a"}, + {file = "pyzmq-26.0.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a42db008d58530efa3b881eeee4991146de0b790e095f7ae43ba5cc612decbc5"}, + {file = "pyzmq-26.0.3-cp37-cp37m-win32.whl", hash = "sha256:8d7a498671ca87e32b54cb47c82a92b40130a26c5197d392720a1bce1b3c77cf"}, + {file = "pyzmq-26.0.3-cp37-cp37m-win_amd64.whl", hash = "sha256:3b4032a96410bdc760061b14ed6a33613ffb7f702181ba999df5d16fb96ba16a"}, + {file = "pyzmq-26.0.3-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:2cc4e280098c1b192c42a849de8de2c8e0f3a84086a76ec5b07bfee29bda7d18"}, + {file = "pyzmq-26.0.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:5bde86a2ed3ce587fa2b207424ce15b9a83a9fa14422dcc1c5356a13aed3df9d"}, + {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:34106f68e20e6ff253c9f596ea50397dbd8699828d55e8fa18bd4323d8d966e6"}, + {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:ebbbd0e728af5db9b04e56389e2299a57ea8b9dd15c9759153ee2455b32be6ad"}, + {file = "pyzmq-26.0.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f6b1d1c631e5940cac5a0b22c5379c86e8df6a4ec277c7a856b714021ab6cfad"}, + {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:e891ce81edd463b3b4c3b885c5603c00141151dd9c6936d98a680c8c72fe5c67"}, + {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:9b273ecfbc590a1b98f014ae41e5cf723932f3b53ba9367cfb676f838038b32c"}, + {file = "pyzmq-26.0.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b32bff85fb02a75ea0b68f21e2412255b5731f3f389ed9aecc13a6752f58ac97"}, + {file = "pyzmq-26.0.3-cp38-cp38-win32.whl", hash = "sha256:f6c21c00478a7bea93caaaef9e7629145d4153b15a8653e8bb4609d4bc70dbfc"}, + {file = "pyzmq-26.0.3-cp38-cp38-win_amd64.whl", hash = "sha256:3401613148d93ef0fd9aabdbddb212de3db7a4475367f49f590c837355343972"}, + {file = "pyzmq-26.0.3-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:2ed8357f4c6e0daa4f3baf31832df8a33334e0fe5b020a61bc8b345a3db7a606"}, + {file = "pyzmq-26.0.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c1c8f2a2ca45292084c75bb6d3a25545cff0ed931ed228d3a1810ae3758f975f"}, + {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:b63731993cdddcc8e087c64e9cf003f909262b359110070183d7f3025d1c56b5"}, + {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b3cd31f859b662ac5d7f4226ec7d8bd60384fa037fc02aee6ff0b53ba29a3ba8"}, + {file = "pyzmq-26.0.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:115f8359402fa527cf47708d6f8a0f8234f0e9ca0cab7c18c9c189c194dbf620"}, + {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:715bdf952b9533ba13dfcf1f431a8f49e63cecc31d91d007bc1deb914f47d0e4"}, + {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:e1258c639e00bf5e8a522fec6c3eaa3e30cf1c23a2f21a586be7e04d50c9acab"}, + {file = "pyzmq-26.0.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:15c59e780be8f30a60816a9adab900c12a58d79c1ac742b4a8df044ab2a6d920"}, + {file = "pyzmq-26.0.3-cp39-cp39-win32.whl", hash = "sha256:d0cdde3c78d8ab5b46595054e5def32a755fc028685add5ddc7403e9f6de9879"}, + {file = "pyzmq-26.0.3-cp39-cp39-win_amd64.whl", hash = "sha256:ce828058d482ef860746bf532822842e0ff484e27f540ef5c813d516dd8896d2"}, + {file = "pyzmq-26.0.3-cp39-cp39-win_arm64.whl", hash = "sha256:788f15721c64109cf720791714dc14afd0f449d63f3a5487724f024345067381"}, + {file = "pyzmq-26.0.3-pp310-pypy310_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2c18645ef6294d99b256806e34653e86236eb266278c8ec8112622b61db255de"}, + {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7e6bc96ebe49604df3ec2c6389cc3876cabe475e6bfc84ced1bf4e630662cb35"}, + {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:971e8990c5cc4ddcff26e149398fc7b0f6a042306e82500f5e8db3b10ce69f84"}, + {file = "pyzmq-26.0.3-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d8416c23161abd94cc7da80c734ad7c9f5dbebdadfdaa77dad78244457448223"}, + {file = "pyzmq-26.0.3-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:082a2988364b60bb5de809373098361cf1dbb239623e39e46cb18bc035ed9c0c"}, + {file = "pyzmq-26.0.3-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d57dfbf9737763b3a60d26e6800e02e04284926329aee8fb01049635e957fe81"}, + {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:77a85dca4c2430ac04dc2a2185c2deb3858a34fe7f403d0a946fa56970cf60a1"}, + {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:4c82a6d952a1d555bf4be42b6532927d2a5686dd3c3e280e5f63225ab47ac1f5"}, + {file = "pyzmq-26.0.3-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4496b1282c70c442809fc1b151977c3d967bfb33e4e17cedbf226d97de18f709"}, + {file = "pyzmq-26.0.3-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:e4946d6bdb7ba972dfda282f9127e5756d4f299028b1566d1245fa0d438847e6"}, + {file = "pyzmq-26.0.3-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:03c0ae165e700364b266876d712acb1ac02693acd920afa67da2ebb91a0b3c09"}, + {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:3e3070e680f79887d60feeda051a58d0ac36622e1759f305a41059eff62c6da7"}, + {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6ca08b840fe95d1c2bd9ab92dac5685f949fc6f9ae820ec16193e5ddf603c3b2"}, + {file = "pyzmq-26.0.3-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e76654e9dbfb835b3518f9938e565c7806976c07b37c33526b574cc1a1050480"}, + {file = "pyzmq-26.0.3-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:871587bdadd1075b112e697173e946a07d722459d20716ceb3d1bd6c64bd08ce"}, + {file = "pyzmq-26.0.3-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:d0a2d1bd63a4ad79483049b26514e70fa618ce6115220da9efdff63688808b17"}, + {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0270b49b6847f0d106d64b5086e9ad5dc8a902413b5dbbb15d12b60f9c1747a4"}, + {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:703c60b9910488d3d0954ca585c34f541e506a091a41930e663a098d3b794c67"}, + {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:74423631b6be371edfbf7eabb02ab995c2563fee60a80a30829176842e71722a"}, + {file = "pyzmq-26.0.3-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:4adfbb5451196842a88fda3612e2c0414134874bffb1c2ce83ab4242ec9e027d"}, + {file = "pyzmq-26.0.3-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:3516119f4f9b8671083a70b6afaa0a070f5683e431ab3dc26e9215620d7ca1ad"}, + {file = "pyzmq-26.0.3.tar.gz", hash = "sha256:dba7d9f2e047dfa2bca3b01f4f84aa5246725203d6284e3790f2ca15fba6b40a"}, ] [package.dependencies] @@ -4040,7 +4137,7 @@ toml = ">=0.10.2,<0.11.0" [[package]] name = "qibojit" -version = "0.1.4" +version = "0.1.5" description = "Simulation tools based on numba and cupy." optional = false python-versions = "^3.9,<3.13" @@ -4050,14 +4147,18 @@ develop = false [package.dependencies] numba = ">=0.59.0" psutil = "^5.9.5" -qibo = {git = "https://github.com/qiboteam/qibo.git"} +qibo = "^0.2.8" scipy = "^1.10.1" +[package.extras] +cupy = ["cupy-cuda12x (>=13.1.0,<14.0.0)"] +cuquantum = ["cuquantum-python-cu12 (>=23.10.0,<24.0.0)"] + [package.source] type = "git" url = "https://github.com/qiboteam/qibojit.git" reference = "HEAD" -resolved_reference = "df23518a094c357c44598ab01530f4534be555ab" +resolved_reference = "683a19467797c8a4d7deaf1a3a1f10a1baca66ca" [[package]] name = "qibotn" @@ -4069,7 +4170,7 @@ files = [] develop = false [package.dependencies] -qibo = {git = "https://github.com/qiboteam/qibo.git"} +qibo = "^0.2.8" quimb = {version = "^1.6.0", extras = ["tensor"]} [package.extras] @@ -4079,17 +4180,17 @@ cuda = ["cupy-cuda11x (>=11.6.0,<12.0.0)", "cuquantum-python-cu11 (>=23.3.0,<24. type = "git" url = "https://github.com/qiboteam/qibotn.git" reference = "HEAD" -resolved_reference = "6814fdbe19df19678299f9a4f662410256762ac1" +resolved_reference = "abb0e363cedfcc2c3f522d360e04ac6f2b5a24f1" [[package]] name = "quimb" -version = "1.8.0" +version = "1.8.1" description = "Quantum information and many-body library." optional = false python-versions = ">=3.8" files = [ - {file = "quimb-1.8.0-py3-none-any.whl", hash = "sha256:ce158debf65676fe0bf982c09085909478106929a2497ea20c696ac8c46ed244"}, - {file = "quimb-1.8.0.tar.gz", hash = "sha256:d5f2c696b2cfaf78c98b3b905db6f7615809c15193a7d4fe98055f037ec50a24"}, + {file = "quimb-1.8.1-py3-none-any.whl", hash = "sha256:b01c6f1e8470fc76b54216eaa78cd276f394011992d29c780443087f7656a690"}, + {file = "quimb-1.8.1.tar.gz", hash = "sha256:5fea3e07b076c717fa354505a11ccb9b3627712fa3d6e722ee9b293ba8d643ea"}, ] [package.dependencies] @@ -4128,13 +4229,13 @@ sphinx = ">=1.3.1" [[package]] name = "requests" -version = "2.31.0" +version = "2.32.3" description = "Python HTTP for Humans." optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "requests-2.31.0-py3-none-any.whl", hash = "sha256:58cd2187c01e70e6e26505bca751777aa9f2ee0b7f4300988b709f44e013003f"}, - {file = "requests-2.31.0.tar.gz", hash = "sha256:942c5a758f98d790eaed1a29cb6eefc7ffb0d1cf7af05c3d2791656dbd6ad1e1"}, + {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"}, + {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"}, ] [package.dependencies] @@ -4316,78 +4417,81 @@ files = [ [[package]] name = "scikit-learn" -version = "1.4.2" +version = "1.5.0" description = "A set of python modules for machine learning and data mining" optional = false python-versions = ">=3.9" files = [ - {file = "scikit-learn-1.4.2.tar.gz", hash = "sha256:daa1c471d95bad080c6e44b4946c9390a4842adc3082572c20e4f8884e39e959"}, - {file = "scikit_learn-1.4.2-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:8539a41b3d6d1af82eb629f9c57f37428ff1481c1e34dddb3b9d7af8ede67ac5"}, - {file = "scikit_learn-1.4.2-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:68b8404841f944a4a1459b07198fa2edd41a82f189b44f3e1d55c104dbc2e40c"}, - {file = "scikit_learn-1.4.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:81bf5d8bbe87643103334032dd82f7419bc8c8d02a763643a6b9a5c7288c5054"}, - {file = "scikit_learn-1.4.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:36f0ea5d0f693cb247a073d21a4123bdf4172e470e6d163c12b74cbb1536cf38"}, - {file = "scikit_learn-1.4.2-cp310-cp310-win_amd64.whl", hash = "sha256:87440e2e188c87db80ea4023440923dccbd56fbc2d557b18ced00fef79da0727"}, - {file = "scikit_learn-1.4.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:45dee87ac5309bb82e3ea633955030df9bbcb8d2cdb30383c6cd483691c546cc"}, - {file = "scikit_learn-1.4.2-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:1d0b25d9c651fd050555aadd57431b53d4cf664e749069da77f3d52c5ad14b3b"}, - {file = "scikit_learn-1.4.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b0203c368058ab92efc6168a1507d388d41469c873e96ec220ca8e74079bf62e"}, - {file = "scikit_learn-1.4.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44c62f2b124848a28fd695db5bc4da019287abf390bfce602ddc8aa1ec186aae"}, - {file = "scikit_learn-1.4.2-cp311-cp311-win_amd64.whl", hash = "sha256:5cd7b524115499b18b63f0c96f4224eb885564937a0b3477531b2b63ce331904"}, - {file = "scikit_learn-1.4.2-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:90378e1747949f90c8f385898fff35d73193dfcaec3dd75d6b542f90c4e89755"}, - {file = "scikit_learn-1.4.2-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:ff4effe5a1d4e8fed260a83a163f7dbf4f6087b54528d8880bab1d1377bd78be"}, - {file = "scikit_learn-1.4.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:671e2f0c3f2c15409dae4f282a3a619601fa824d2c820e5b608d9d775f91780c"}, - {file = "scikit_learn-1.4.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d36d0bc983336bbc1be22f9b686b50c964f593c8a9a913a792442af9bf4f5e68"}, - {file = "scikit_learn-1.4.2-cp312-cp312-win_amd64.whl", hash = "sha256:d762070980c17ba3e9a4a1e043ba0518ce4c55152032f1af0ca6f39b376b5928"}, - {file = "scikit_learn-1.4.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d9993d5e78a8148b1d0fdf5b15ed92452af5581734129998c26f481c46586d68"}, - {file = "scikit_learn-1.4.2-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:426d258fddac674fdf33f3cb2d54d26f49406e2599dbf9a32b4d1696091d4256"}, - {file = "scikit_learn-1.4.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5460a1a5b043ae5ae4596b3126a4ec33ccba1b51e7ca2c5d36dac2169f62ab1d"}, - {file = "scikit_learn-1.4.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49d64ef6cb8c093d883e5a36c4766548d974898d378e395ba41a806d0e824db8"}, - {file = "scikit_learn-1.4.2-cp39-cp39-win_amd64.whl", hash = "sha256:c97a50b05c194be9146d61fe87dbf8eac62b203d9e87a3ccc6ae9aed2dfaf361"}, + {file = "scikit_learn-1.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:12e40ac48555e6b551f0a0a5743cc94cc5a765c9513fe708e01f0aa001da2801"}, + {file = "scikit_learn-1.5.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:f405c4dae288f5f6553b10c4ac9ea7754d5180ec11e296464adb5d6ac68b6ef5"}, + {file = "scikit_learn-1.5.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df8ccabbf583315f13160a4bb06037bde99ea7d8211a69787a6b7c5d4ebb6fc3"}, + {file = "scikit_learn-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2c75ea812cd83b1385bbfa94ae971f0d80adb338a9523f6bbcb5e0b0381151d4"}, + {file = "scikit_learn-1.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:a90c5da84829a0b9b4bf00daf62754b2be741e66b5946911f5bdfaa869fcedd6"}, + {file = "scikit_learn-1.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:2a65af2d8a6cce4e163a7951a4cfbfa7fceb2d5c013a4b593686c7f16445cf9d"}, + {file = "scikit_learn-1.5.0-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:4c0c56c3005f2ec1db3787aeaabefa96256580678cec783986836fc64f8ff622"}, + {file = "scikit_learn-1.5.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1f77547165c00625551e5c250cefa3f03f2fc92c5e18668abd90bfc4be2e0bff"}, + {file = "scikit_learn-1.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:118a8d229a41158c9f90093e46b3737120a165181a1b58c03461447aa4657415"}, + {file = "scikit_learn-1.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:a03b09f9f7f09ffe8c5efffe2e9de1196c696d811be6798ad5eddf323c6f4d40"}, + {file = "scikit_learn-1.5.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:460806030c666addee1f074788b3978329a5bfdc9b7d63e7aad3f6d45c67a210"}, + {file = "scikit_learn-1.5.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:1b94d6440603752b27842eda97f6395f570941857456c606eb1d638efdb38184"}, + {file = "scikit_learn-1.5.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d82c2e573f0f2f2f0be897e7a31fcf4e73869247738ab8c3ce7245549af58ab8"}, + {file = "scikit_learn-1.5.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a3a10e1d9e834e84d05e468ec501a356226338778769317ee0b84043c0d8fb06"}, + {file = "scikit_learn-1.5.0-cp312-cp312-win_amd64.whl", hash = "sha256:855fc5fa8ed9e4f08291203af3d3e5fbdc4737bd617a371559aaa2088166046e"}, + {file = "scikit_learn-1.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:40fb7d4a9a2db07e6e0cae4dc7bdbb8fada17043bac24104d8165e10e4cff1a2"}, + {file = "scikit_learn-1.5.0-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:47132440050b1c5beb95f8ba0b2402bbd9057ce96ec0ba86f2f445dd4f34df67"}, + {file = "scikit_learn-1.5.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:174beb56e3e881c90424e21f576fa69c4ffcf5174632a79ab4461c4c960315ac"}, + {file = "scikit_learn-1.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:261fe334ca48f09ed64b8fae13f9b46cc43ac5f580c4a605cbb0a517456c8f71"}, + {file = "scikit_learn-1.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:057b991ac64b3e75c9c04b5f9395eaf19a6179244c089afdebaad98264bff37c"}, + {file = "scikit_learn-1.5.0.tar.gz", hash = "sha256:789e3db01c750ed6d496fa2db7d50637857b451e57bcae863bff707c1247bef7"}, ] [package.dependencies] joblib = ">=1.2.0" numpy = ">=1.19.5" scipy = ">=1.6.0" -threadpoolctl = ">=2.0.0" +threadpoolctl = ">=3.1.0" [package.extras] -benchmark = ["matplotlib (>=3.3.4)", "memory-profiler (>=0.57.0)", "pandas (>=1.1.5)"] -docs = ["Pillow (>=7.1.2)", "matplotlib (>=3.3.4)", "memory-profiler (>=0.57.0)", "numpydoc (>=1.2.0)", "pandas (>=1.1.5)", "plotly (>=5.14.0)", "pooch (>=1.6.0)", "scikit-image (>=0.17.2)", "seaborn (>=0.9.0)", "sphinx (>=6.0.0)", "sphinx-copybutton (>=0.5.2)", "sphinx-gallery (>=0.15.0)", "sphinx-prompt (>=1.3.0)", "sphinxext-opengraph (>=0.4.2)"] +benchmark = ["matplotlib (>=3.3.4)", "memory_profiler (>=0.57.0)", "pandas (>=1.1.5)"] +build = ["cython (>=3.0.10)", "meson-python (>=0.15.0)", "numpy (>=1.19.5)", "scipy (>=1.6.0)"] +docs = ["Pillow (>=7.1.2)", "matplotlib (>=3.3.4)", "memory_profiler (>=0.57.0)", "numpydoc (>=1.2.0)", "pandas (>=1.1.5)", "plotly (>=5.14.0)", "polars (>=0.20.23)", "pooch (>=1.6.0)", "scikit-image (>=0.17.2)", "seaborn (>=0.9.0)", "sphinx (>=6.0.0)", "sphinx-copybutton (>=0.5.2)", "sphinx-gallery (>=0.15.0)", "sphinx-prompt (>=1.3.0)", "sphinxext-opengraph (>=0.4.2)"] examples = ["matplotlib (>=3.3.4)", "pandas (>=1.1.5)", "plotly (>=5.14.0)", "pooch (>=1.6.0)", "scikit-image (>=0.17.2)", "seaborn (>=0.9.0)"] -tests = ["black (>=23.3.0)", "matplotlib (>=3.3.4)", "mypy (>=1.3)", "numpydoc (>=1.2.0)", "pandas (>=1.1.5)", "polars (>=0.19.12)", "pooch (>=1.6.0)", "pyamg (>=4.0.0)", "pyarrow (>=12.0.0)", "pytest (>=7.1.2)", "pytest-cov (>=2.9.0)", "ruff (>=0.0.272)", "scikit-image (>=0.17.2)"] +install = ["joblib (>=1.2.0)", "numpy (>=1.19.5)", "scipy (>=1.6.0)", "threadpoolctl (>=3.1.0)"] +maintenance = ["conda-lock (==2.5.6)"] +tests = ["black (>=24.3.0)", "matplotlib (>=3.3.4)", "mypy (>=1.9)", "numpydoc (>=1.2.0)", "pandas (>=1.1.5)", "polars (>=0.20.23)", "pooch (>=1.6.0)", "pyamg (>=4.0.0)", "pyarrow (>=12.0.0)", "pytest (>=7.1.2)", "pytest-cov (>=2.9.0)", "ruff (>=0.2.1)", "scikit-image (>=0.17.2)"] [[package]] name = "scipy" -version = "1.13.0" +version = "1.13.1" description = "Fundamental algorithms for scientific computing in Python" optional = false python-versions = ">=3.9" files = [ - {file = "scipy-1.13.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ba419578ab343a4e0a77c0ef82f088238a93eef141b2b8017e46149776dfad4d"}, - {file = "scipy-1.13.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:22789b56a999265431c417d462e5b7f2b487e831ca7bef5edeb56efe4c93f86e"}, - {file = "scipy-1.13.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:05f1432ba070e90d42d7fd836462c50bf98bd08bed0aa616c359eed8a04e3922"}, - {file = "scipy-1.13.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b8434f6f3fa49f631fae84afee424e2483289dfc30a47755b4b4e6b07b2633a4"}, - {file = "scipy-1.13.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:dcbb9ea49b0167de4167c40eeee6e167caeef11effb0670b554d10b1e693a8b9"}, - {file = "scipy-1.13.0-cp310-cp310-win_amd64.whl", hash = "sha256:1d2f7bb14c178f8b13ebae93f67e42b0a6b0fc50eba1cd8021c9b6e08e8fb1cd"}, - {file = "scipy-1.13.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0fbcf8abaf5aa2dc8d6400566c1a727aed338b5fe880cde64907596a89d576fa"}, - {file = "scipy-1.13.0-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:5e4a756355522eb60fcd61f8372ac2549073c8788f6114449b37e9e8104f15a5"}, - {file = "scipy-1.13.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b5acd8e1dbd8dbe38d0004b1497019b2dbbc3d70691e65d69615f8a7292865d7"}, - {file = "scipy-1.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9ff7dad5d24a8045d836671e082a490848e8639cabb3dbdacb29f943a678683d"}, - {file = "scipy-1.13.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:4dca18c3ffee287ddd3bc8f1dabaf45f5305c5afc9f8ab9cbfab855e70b2df5c"}, - {file = "scipy-1.13.0-cp311-cp311-win_amd64.whl", hash = "sha256:a2f471de4d01200718b2b8927f7d76b5d9bde18047ea0fa8bd15c5ba3f26a1d6"}, - {file = "scipy-1.13.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:d0de696f589681c2802f9090fff730c218f7c51ff49bf252b6a97ec4a5d19e8b"}, - {file = "scipy-1.13.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:b2a3ff461ec4756b7e8e42e1c681077349a038f0686132d623fa404c0bee2551"}, - {file = "scipy-1.13.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6bf9fe63e7a4bf01d3645b13ff2aa6dea023d38993f42aaac81a18b1bda7a82a"}, - {file = "scipy-1.13.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1e7626dfd91cdea5714f343ce1176b6c4745155d234f1033584154f60ef1ff42"}, - {file = "scipy-1.13.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:109d391d720fcebf2fbe008621952b08e52907cf4c8c7efc7376822151820820"}, - {file = "scipy-1.13.0-cp312-cp312-win_amd64.whl", hash = "sha256:8930ae3ea371d6b91c203b1032b9600d69c568e537b7988a3073dfe4d4774f21"}, - {file = "scipy-1.13.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5407708195cb38d70fd2d6bb04b1b9dd5c92297d86e9f9daae1576bd9e06f602"}, - {file = "scipy-1.13.0-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:ac38c4c92951ac0f729c4c48c9e13eb3675d9986cc0c83943784d7390d540c78"}, - {file = "scipy-1.13.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:09c74543c4fbeb67af6ce457f6a6a28e5d3739a87f62412e4a16e46f164f0ae5"}, - {file = "scipy-1.13.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:28e286bf9ac422d6beb559bc61312c348ca9b0f0dae0d7c5afde7f722d6ea13d"}, - {file = "scipy-1.13.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:33fde20efc380bd23a78a4d26d59fc8704e9b5fd9b08841693eb46716ba13d86"}, - {file = "scipy-1.13.0-cp39-cp39-win_amd64.whl", hash = "sha256:45c08bec71d3546d606989ba6e7daa6f0992918171e2a6f7fbedfa7361c2de1e"}, - {file = "scipy-1.13.0.tar.gz", hash = "sha256:58569af537ea29d3f78e5abd18398459f195546bb3be23d16677fb26616cc11e"}, + {file = "scipy-1.13.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:20335853b85e9a49ff7572ab453794298bcf0354d8068c5f6775a0eabf350aca"}, + {file = "scipy-1.13.1-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:d605e9c23906d1994f55ace80e0125c587f96c020037ea6aa98d01b4bd2e222f"}, + {file = "scipy-1.13.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cfa31f1def5c819b19ecc3a8b52d28ffdcc7ed52bb20c9a7589669dd3c250989"}, + {file = "scipy-1.13.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f26264b282b9da0952a024ae34710c2aff7d27480ee91a2e82b7b7073c24722f"}, + {file = "scipy-1.13.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:eccfa1906eacc02de42d70ef4aecea45415f5be17e72b61bafcfd329bdc52e94"}, + {file = "scipy-1.13.1-cp310-cp310-win_amd64.whl", hash = "sha256:2831f0dc9c5ea9edd6e51e6e769b655f08ec6db6e2e10f86ef39bd32eb11da54"}, + {file = "scipy-1.13.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:27e52b09c0d3a1d5b63e1105f24177e544a222b43611aaf5bc44d4a0979e32f9"}, + {file = "scipy-1.13.1-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:54f430b00f0133e2224c3ba42b805bfd0086fe488835effa33fa291561932326"}, + {file = "scipy-1.13.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e89369d27f9e7b0884ae559a3a956e77c02114cc60a6058b4e5011572eea9299"}, + {file = "scipy-1.13.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a78b4b3345f1b6f68a763c6e25c0c9a23a9fd0f39f5f3d200efe8feda560a5fa"}, + {file = "scipy-1.13.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:45484bee6d65633752c490404513b9ef02475b4284c4cfab0ef946def50b3f59"}, + {file = "scipy-1.13.1-cp311-cp311-win_amd64.whl", hash = "sha256:5713f62f781eebd8d597eb3f88b8bf9274e79eeabf63afb4a737abc6c84ad37b"}, + {file = "scipy-1.13.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5d72782f39716b2b3509cd7c33cdc08c96f2f4d2b06d51e52fb45a19ca0c86a1"}, + {file = "scipy-1.13.1-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:017367484ce5498445aade74b1d5ab377acdc65e27095155e448c88497755a5d"}, + {file = "scipy-1.13.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:949ae67db5fa78a86e8fa644b9a6b07252f449dcf74247108c50e1d20d2b4627"}, + {file = "scipy-1.13.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:de3ade0e53bc1f21358aa74ff4830235d716211d7d077e340c7349bc3542e884"}, + {file = "scipy-1.13.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2ac65fb503dad64218c228e2dc2d0a0193f7904747db43014645ae139c8fad16"}, + {file = "scipy-1.13.1-cp312-cp312-win_amd64.whl", hash = "sha256:cdd7dacfb95fea358916410ec61bbc20440f7860333aee6d882bb8046264e949"}, + {file = "scipy-1.13.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:436bbb42a94a8aeef855d755ce5a465479c721e9d684de76bf61a62e7c2b81d5"}, + {file = "scipy-1.13.1-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:8335549ebbca860c52bf3d02f80784e91a004b71b059e3eea9678ba994796a24"}, + {file = "scipy-1.13.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d533654b7d221a6a97304ab63c41c96473ff04459e404b83275b60aa8f4b7004"}, + {file = "scipy-1.13.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:637e98dcf185ba7f8e663e122ebf908c4702420477ae52a04f9908707456ba4d"}, + {file = "scipy-1.13.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:a014c2b3697bde71724244f63de2476925596c24285c7a637364761f8710891c"}, + {file = "scipy-1.13.1-cp39-cp39-win_amd64.whl", hash = "sha256:392e4ec766654852c25ebad4f64e4e584cf19820b980bc04960bca0b0cd6eaa2"}, + {file = "scipy-1.13.1.tar.gz", hash = "sha256:095a87a0312b08dfd6a6155cbbd310a8c51800fc931b8c0b84003014b874ed3c"}, ] [package.dependencies] @@ -4398,6 +4502,27 @@ dev = ["cython-lint (>=0.12.2)", "doit (>=0.36.0)", "mypy", "pycodestyle", "pyde doc = ["jupyterlite-pyodide-kernel", "jupyterlite-sphinx (>=0.12.0)", "jupytext", "matplotlib (>=3.5)", "myst-nb", "numpydoc", "pooch", "pydata-sphinx-theme (>=0.15.2)", "sphinx (>=5.0.0)", "sphinx-design (>=0.4.0)"] test = ["array-api-strict", "asv", "gmpy2", "hypothesis (>=6.30)", "mpmath", "pooch", "pytest", "pytest-cov", "pytest-timeout", "pytest-xdist", "scikit-umfpack", "threadpoolctl"] +[[package]] +name = "seaborn" +version = "0.13.2" +description = "Statistical data visualization" +optional = false +python-versions = ">=3.8" +files = [ + {file = "seaborn-0.13.2-py3-none-any.whl", hash = "sha256:636f8336facf092165e27924f223d3c62ca560b1f2bb5dff7ab7fad265361987"}, + {file = "seaborn-0.13.2.tar.gz", hash = "sha256:93e60a40988f4d65e9f4885df477e2fdaff6b73a9ded434c1ab356dd57eefff7"}, +] + +[package.dependencies] +matplotlib = ">=3.4,<3.6.1 || >3.6.1" +numpy = ">=1.20,<1.24.0 || >1.24.0" +pandas = ">=1.2" + +[package.extras] +dev = ["flake8", "flit", "mypy", "pandas-stubs", "pre-commit", "pytest", "pytest-cov", "pytest-xdist"] +docs = ["ipykernel", "nbconvert", "numpydoc", "pydata_sphinx_theme (==0.10.0rc2)", "pyyaml", "sphinx (<6.0.0)", "sphinx-copybutton", "sphinx-design", "sphinx-issues"] +stats = ["scipy (>=1.7)", "statsmodels (>=0.12)"] + [[package]] name = "setuptools" version = "69.5.1" @@ -4729,17 +4854,17 @@ numpy = "*" [[package]] name = "sympy" -version = "1.12" +version = "1.12.1" description = "Computer algebra system (CAS) in Python" optional = false python-versions = ">=3.8" files = [ - {file = "sympy-1.12-py3-none-any.whl", hash = "sha256:c3588cd4295d0c0f603d0f2ae780587e64e2efeedb3521e46b9bb1d08d184fa5"}, - {file = "sympy-1.12.tar.gz", hash = "sha256:ebf595c8dac3e0fdc4152c51878b498396ec7f30e7a914d6071e674d49420fb8"}, + {file = "sympy-1.12.1-py3-none-any.whl", hash = "sha256:9b2cbc7f1a640289430e13d2a56f02f867a1da0190f2f99d8968c2f74da0e515"}, + {file = "sympy-1.12.1.tar.gz", hash = "sha256:2877b03f998cd8c08f07cd0de5b767119cd3ef40d09f41c30d722f6686b0fb88"}, ] [package.dependencies] -mpmath = ">=0.19" +mpmath = ">=1.1.0,<1.4.0" [[package]] name = "tabulate" @@ -4770,17 +4895,18 @@ files = [ [[package]] name = "tenacity" -version = "8.2.3" +version = "8.3.0" description = "Retry code until it succeeds" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "tenacity-8.2.3-py3-none-any.whl", hash = "sha256:ce510e327a630c9e1beaf17d42e6ffacc88185044ad85cf74c0a8887c6a0f88c"}, - {file = "tenacity-8.2.3.tar.gz", hash = "sha256:5398ef0d78e63f40007c1fb4c0bff96e1911394d2fa8d194f77619c05ff6cc8a"}, + {file = "tenacity-8.3.0-py3-none-any.whl", hash = "sha256:3649f6443dbc0d9b01b9d8020a9c4ec7a1ff5f6f3c6c8a036ef371f573fe9185"}, + {file = "tenacity-8.3.0.tar.gz", hash = "sha256:953d4e6ad24357bceffbc9707bc74349aca9d245f68eb65419cf0c249a1949a2"}, ] [package.extras] -doc = ["reno", "sphinx", "tornado (>=4.5)"] +doc = ["reno", "sphinx"] +test = ["pytest", "tornado (>=4.5)", "typeguard"] [[package]] name = "tensorboard" @@ -4876,32 +5002,35 @@ and-cuda = ["nvidia-cublas-cu12 (==12.3.4.1)", "nvidia-cuda-cupti-cu12 (==12.3.1 [[package]] name = "tensorflow-io-gcs-filesystem" -version = "0.36.0" +version = "0.37.0" description = "TensorFlow IO" optional = false -python-versions = ">=3.7, <3.12" -files = [ - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:702c6df62b38095ff613c433546d9424d4f33902a5ab26b00fd26457e27a99fa"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:e9b8aaca2789af356c42afda0f52380f82e5abb2f3c0b85087833fcfe03875d8"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c477aed96864ceae77d7051c3b687f28813aba7320fc5dd552164fad6ec8d1a1"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be1ff92559dfa23048b01179a1827081947583f5c6f9986ccac471df8a29322a"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:72c3ca4b8c0d8dbdd970699d05a100107cf200317ad8e6a8373e2c37225cd552"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:848e8e89a0f49258c7782189c938d8d1162d989da1a80c79f95c7af3ef6006c8"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4d72db1ab03edb65fa1e98d06e504ccbc64282d38ab3589afb6db66dc448d1c1"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1bd4d946b5fa23220daa473a80e511a5fb27493d7e49d17dff0bb43bb0a31f32"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fa346fd1dd9f57848b73874007440504f060fadd689fa1cc29cc49817d0eeaf3"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:0a4437824424a4423cf86162cb8b21b1bec24698194332748b50bb952e62ab9f"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:31806bd7ac2db789161bc720747de22947063265561a4c17be54698fd9780b03"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc0e57976c1aa035af6281f0330cfb8dd50eee2f63412ecc84d60ff5075d29b7"}, - {file = "tensorflow_io_gcs_filesystem-0.36.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e97ff5c280eb10f699098ae21057be2b146d39e8a906cd5db91f2ea6c34e47d0"}, +python-versions = "<3.12,>=3.7" +files = [ + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:82cc4d8e26fb143fc814ac8ab95fede83363a315f5b62f8ae68312f1aca1cc6e"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp310-cp310-macosx_12_0_arm64.whl", hash = "sha256:677d6d7c84a94a3b27ea5d16633ea09adadef09c2630480e8e94209558828b02"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e5d1ac4d2010e8cdf259918ba1500c942b51b7ed2e549f55b404c1fb52f695d"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2901bc4a91158fa0a10d37594c8a5efb1445dd5a041b1b5b90f782a5d1b15e"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp311-cp311-macosx_10_14_x86_64.whl", hash = "sha256:eab6e4c1daf7ddbfef608cd8e2102861021678dfb3f6a7fb3f613db9d6992919"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp311-cp311-macosx_12_0_arm64.whl", hash = "sha256:4ec3c0d0a9d3676a2e74198e3dff66d74c7c34f974257f2176236d0703b31a0e"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:af0f79400656bb88bf326d2b8e63aef49c07a0ce8c14c3e2589a62e765d8c21f"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:13bc337f2c2db63a39c81c8fd0ececc0c3d5fcf4ce229dfed0b0085a23dd60e9"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp312-cp312-macosx_10_14_x86_64.whl", hash = "sha256:57e7af9c81e79bf8fb552985dc8972ac90437d34bd4c1c9019a92a07eb12bc98"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp312-cp312-macosx_12_0_arm64.whl", hash = "sha256:48a8e7aec651bea8db410f6426c6446a56d16a5ab32201a70d8d684c113137b7"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:71ccf64a137efcb2be2627225b4e48110cbf34da39b23c5cc688fe803f2510f1"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:03d5598b8007551f4e1391bf85a83a1865e3fa0789beef15a200efaa06a23fb5"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:8d3ad5f30b6dbe09baefdb80e9aa7ff3869c772928b865f8ffc8402be7675a43"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp39-cp39-macosx_12_0_arm64.whl", hash = "sha256:95bb229e968fca943806c6ac04e81dc4966fc4a36ab83efaa061a4ecb3ea5e85"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8385f4fe447812bd8e2e11ef523cf02765319100e5d9e4a9b5a876d4440c900c"}, + {file = "tensorflow_io_gcs_filesystem-0.37.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:500ec871a8d59cf78992b7fd4750d86ea3d35e231fb0bea7a7eabcf73abfceeb"}, ] [package.extras] -tensorflow = ["tensorflow (>=2.15.0,<2.16.0)"] -tensorflow-aarch64 = ["tensorflow-aarch64 (>=2.15.0,<2.16.0)"] -tensorflow-cpu = ["tensorflow-cpu (>=2.15.0,<2.16.0)"] -tensorflow-gpu = ["tensorflow-gpu (>=2.15.0,<2.16.0)"] -tensorflow-rocm = ["tensorflow-rocm (>=2.15.0,<2.16.0)"] +tensorflow = ["tensorflow (>=2.16.0,<2.17.0)"] +tensorflow-aarch64 = ["tensorflow-aarch64 (>=2.16.0,<2.17.0)"] +tensorflow-cpu = ["tensorflow-cpu (>=2.16.0,<2.17.0)"] +tensorflow-gpu = ["tensorflow-gpu (>=2.16.0,<2.17.0)"] +tensorflow-rocm = ["tensorflow-rocm (>=2.16.0,<2.17.0)"] [[package]] name = "termcolor" @@ -4970,13 +5099,13 @@ files = [ [[package]] name = "tomlkit" -version = "0.12.4" +version = "0.12.5" description = "Style preserving TOML library" optional = false python-versions = ">=3.7" files = [ - {file = "tomlkit-0.12.4-py3-none-any.whl", hash = "sha256:5cd82d48a3dd89dee1f9d64420aa20ae65cfbd00668d6f094d7578a78efbb77b"}, - {file = "tomlkit-0.12.4.tar.gz", hash = "sha256:7ca1cfc12232806517a8515047ba66a19369e71edf2439d0f5824f91032b6cc3"}, + {file = "tomlkit-0.12.5-py3-none-any.whl", hash = "sha256:af914f5a9c59ed9d0762c7b64d3b5d5df007448eb9cd2edc8a46b1eafead172f"}, + {file = "tomlkit-0.12.5.tar.gz", hash = "sha256:eef34fba39834d4d6b73c9ba7f3e4d1c417a4e56f89a7e96e090dd0d24b8fb3c"}, ] [[package]] @@ -4992,31 +5121,31 @@ files = [ [[package]] name = "torch" -version = "2.3.0" +version = "2.3.1" description = "Tensors and Dynamic neural networks in Python with strong GPU acceleration" optional = false python-versions = ">=3.8.0" files = [ - {file = "torch-2.3.0-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:d8ea5a465dbfd8501f33c937d1f693176c9aef9d1c1b0ca1d44ed7b0a18c52ac"}, - {file = "torch-2.3.0-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:09c81c5859a5b819956c6925a405ef1cdda393c9d8a01ce3851453f699d3358c"}, - {file = "torch-2.3.0-cp310-cp310-win_amd64.whl", hash = "sha256:1bf023aa20902586f614f7682fedfa463e773e26c58820b74158a72470259459"}, - {file = "torch-2.3.0-cp310-none-macosx_11_0_arm64.whl", hash = "sha256:758ef938de87a2653bba74b91f703458c15569f1562bf4b6c63c62d9c5a0c1f5"}, - {file = "torch-2.3.0-cp311-cp311-manylinux1_x86_64.whl", hash = "sha256:493d54ee2f9df100b5ce1d18c96dbb8d14908721f76351e908c9d2622773a788"}, - {file = "torch-2.3.0-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:bce43af735c3da16cc14c7de2be7ad038e2fbf75654c2e274e575c6c05772ace"}, - {file = "torch-2.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:729804e97b7cf19ae9ab4181f91f5e612af07956f35c8b2c8e9d9f3596a8e877"}, - {file = "torch-2.3.0-cp311-none-macosx_11_0_arm64.whl", hash = "sha256:d24e328226d8e2af7cf80fcb1d2f1d108e0de32777fab4aaa2b37b9765d8be73"}, - {file = "torch-2.3.0-cp312-cp312-manylinux1_x86_64.whl", hash = "sha256:b0de2bdc0486ea7b14fc47ff805172df44e421a7318b7c4d92ef589a75d27410"}, - {file = "torch-2.3.0-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:a306c87a3eead1ed47457822c01dfbd459fe2920f2d38cbdf90de18f23f72542"}, - {file = "torch-2.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:f9b98bf1a3c8af2d4c41f0bf1433920900896c446d1ddc128290ff146d1eb4bd"}, - {file = "torch-2.3.0-cp312-none-macosx_11_0_arm64.whl", hash = "sha256:dca986214267b34065a79000cee54232e62b41dff1ec2cab9abc3fc8b3dee0ad"}, - {file = "torch-2.3.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:20572f426965dd8a04e92a473d7e445fa579e09943cc0354f3e6fef6130ce061"}, - {file = "torch-2.3.0-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:e65ba85ae292909cde0dde6369826d51165a3fc8823dc1854cd9432d7f79b932"}, - {file = "torch-2.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:5515503a193781fd1b3f5c474e89c9dfa2faaa782b2795cc4a7ab7e67de923f6"}, - {file = "torch-2.3.0-cp38-none-macosx_11_0_arm64.whl", hash = "sha256:6ae9f64b09516baa4ef890af0672dc981c20b1f0d829ce115d4420a247e88fba"}, - {file = "torch-2.3.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:cd0dc498b961ab19cb3f8dbf0c6c50e244f2f37dbfa05754ab44ea057c944ef9"}, - {file = "torch-2.3.0-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:e05f836559251e4096f3786ee99f4a8cbe67bc7fbedba8ad5e799681e47c5e80"}, - {file = "torch-2.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:4fb27b35dbb32303c2927da86e27b54a92209ddfb7234afb1949ea2b3effffea"}, - {file = "torch-2.3.0-cp39-none-macosx_11_0_arm64.whl", hash = "sha256:760f8bedff506ce9e6e103498f9b1e9e15809e008368594c3a66bf74a8a51380"}, + {file = "torch-2.3.1-cp310-cp310-manylinux1_x86_64.whl", hash = "sha256:605a25b23944be5ab7c3467e843580e1d888b8066e5aaf17ff7bf9cc30001cc3"}, + {file = "torch-2.3.1-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:f2357eb0965583a0954d6f9ad005bba0091f956aef879822274b1bcdb11bd308"}, + {file = "torch-2.3.1-cp310-cp310-win_amd64.whl", hash = "sha256:32b05fe0d1ada7f69c9f86c14ff69b0ef1957a5a54199bacba63d22d8fab720b"}, + {file = "torch-2.3.1-cp310-none-macosx_11_0_arm64.whl", hash = "sha256:7c09a94362778428484bcf995f6004b04952106aee0ef45ff0b4bab484f5498d"}, + {file = "torch-2.3.1-cp311-cp311-manylinux1_x86_64.whl", hash = "sha256:b2ec81b61bb094ea4a9dee1cd3f7b76a44555375719ad29f05c0ca8ef596ad39"}, + {file = "torch-2.3.1-cp311-cp311-manylinux2014_aarch64.whl", hash = "sha256:490cc3d917d1fe0bd027057dfe9941dc1d6d8e3cae76140f5dd9a7e5bc7130ab"}, + {file = "torch-2.3.1-cp311-cp311-win_amd64.whl", hash = "sha256:5802530783bd465fe66c2df99123c9a54be06da118fbd785a25ab0a88123758a"}, + {file = "torch-2.3.1-cp311-none-macosx_11_0_arm64.whl", hash = "sha256:a7dd4ed388ad1f3d502bf09453d5fe596c7b121de7e0cfaca1e2017782e9bbac"}, + {file = "torch-2.3.1-cp312-cp312-manylinux1_x86_64.whl", hash = "sha256:a486c0b1976a118805fc7c9641d02df7afbb0c21e6b555d3bb985c9f9601b61a"}, + {file = "torch-2.3.1-cp312-cp312-manylinux2014_aarch64.whl", hash = "sha256:224259821fe3e4c6f7edf1528e4fe4ac779c77addaa74215eb0b63a5c474d66c"}, + {file = "torch-2.3.1-cp312-cp312-win_amd64.whl", hash = "sha256:e5fdccbf6f1334b2203a61a0e03821d5845f1421defe311dabeae2fc8fbeac2d"}, + {file = "torch-2.3.1-cp312-none-macosx_11_0_arm64.whl", hash = "sha256:3c333dc2ebc189561514eda06e81df22bf8fb64e2384746b2cb9f04f96d1d4c8"}, + {file = "torch-2.3.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:07e9ba746832b8d069cacb45f312cadd8ad02b81ea527ec9766c0e7404bb3feb"}, + {file = "torch-2.3.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:462d1c07dbf6bb5d9d2f3316fee73a24f3d12cd8dacf681ad46ef6418f7f6626"}, + {file = "torch-2.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:ff60bf7ce3de1d43ad3f6969983f321a31f0a45df3690921720bcad6a8596cc4"}, + {file = "torch-2.3.1-cp38-none-macosx_11_0_arm64.whl", hash = "sha256:bee0bd33dc58aa8fc8a7527876e9b9a0e812ad08122054a5bff2ce5abf005b10"}, + {file = "torch-2.3.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:aaa872abde9a3d4f91580f6396d54888620f4a0b92e3976a6034759df4b961ad"}, + {file = "torch-2.3.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:3d7a7f7ef21a7520510553dc3938b0c57c116a7daee20736a9e25cbc0e832bdc"}, + {file = "torch-2.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:4777f6cefa0c2b5fa87223c213e7b6f417cf254a45e5829be4ccd1b2a4ee1011"}, + {file = "torch-2.3.1-cp39-none-macosx_11_0_arm64.whl", hash = "sha256:2bb5af780c55be68fe100feb0528d2edebace1d55cb2e351de735809ba7391eb"}, ] [package.dependencies] @@ -5037,7 +5166,7 @@ nvidia-cusparse-cu12 = {version = "12.1.0.106", markers = "platform_system == \" nvidia-nccl-cu12 = {version = "2.20.5", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""} nvidia-nvtx-cu12 = {version = "12.1.105", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\""} sympy = "*" -triton = {version = "2.3.0", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\" and python_version < \"3.12\""} +triton = {version = "2.3.1", markers = "platform_system == \"Linux\" and platform_machine == \"x86_64\" and python_version < \"3.12\""} typing-extensions = ">=4.8.0" [package.extras] @@ -5046,33 +5175,33 @@ optree = ["optree (>=0.9.1)"] [[package]] name = "tornado" -version = "6.4" +version = "6.4.1" description = "Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed." optional = false -python-versions = ">= 3.8" +python-versions = ">=3.8" files = [ - {file = "tornado-6.4-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:02ccefc7d8211e5a7f9e8bc3f9e5b0ad6262ba2fbb683a6443ecc804e5224ce0"}, - {file = "tornado-6.4-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:27787de946a9cffd63ce5814c33f734c627a87072ec7eed71f7fc4417bb16263"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f7894c581ecdcf91666a0912f18ce5e757213999e183ebfc2c3fdbf4d5bd764e"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e43bc2e5370a6a8e413e1e1cd0c91bedc5bd62a74a532371042a18ef19e10579"}, - {file = "tornado-6.4-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0251554cdd50b4b44362f73ad5ba7126fc5b2c2895cc62b14a1c2d7ea32f212"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:fd03192e287fbd0899dd8f81c6fb9cbbc69194d2074b38f384cb6fa72b80e9c2"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_i686.whl", hash = "sha256:88b84956273fbd73420e6d4b8d5ccbe913c65d31351b4c004ae362eba06e1f78"}, - {file = "tornado-6.4-cp38-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:71ddfc23a0e03ef2df1c1397d859868d158c8276a0603b96cf86892bff58149f"}, - {file = "tornado-6.4-cp38-abi3-win32.whl", hash = "sha256:6f8a6c77900f5ae93d8b4ae1196472d0ccc2775cc1dfdc9e7727889145c45052"}, - {file = "tornado-6.4-cp38-abi3-win_amd64.whl", hash = "sha256:10aeaa8006333433da48dec9fe417877f8bcc21f48dda8d661ae79da357b2a63"}, - {file = "tornado-6.4.tar.gz", hash = "sha256:72291fa6e6bc84e626589f1c29d90a5a6d593ef5ae68052ee2ef000dfd273dee"}, + {file = "tornado-6.4.1-cp38-abi3-macosx_10_9_universal2.whl", hash = "sha256:163b0aafc8e23d8cdc3c9dfb24c5368af84a81e3364745ccb4427669bf84aec8"}, + {file = "tornado-6.4.1-cp38-abi3-macosx_10_9_x86_64.whl", hash = "sha256:6d5ce3437e18a2b66fbadb183c1d3364fb03f2be71299e7d10dbeeb69f4b2a14"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e2e20b9113cd7293f164dc46fffb13535266e713cdb87bd2d15ddb336e96cfc4"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8ae50a504a740365267b2a8d1a90c9fbc86b780a39170feca9bcc1787ff80842"}, + {file = "tornado-6.4.1-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:613bf4ddf5c7a95509218b149b555621497a6cc0d46ac341b30bd9ec19eac7f3"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:25486eb223babe3eed4b8aecbac33b37e3dd6d776bc730ca14e1bf93888b979f"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_i686.whl", hash = "sha256:454db8a7ecfcf2ff6042dde58404164d969b6f5d58b926da15e6b23817950fc4"}, + {file = "tornado-6.4.1-cp38-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:a02a08cc7a9314b006f653ce40483b9b3c12cda222d6a46d4ac63bb6c9057698"}, + {file = "tornado-6.4.1-cp38-abi3-win32.whl", hash = "sha256:d9a566c40b89757c9aa8e6f032bcdb8ca8795d7c1a9762910c722b1635c9de4d"}, + {file = "tornado-6.4.1-cp38-abi3-win_amd64.whl", hash = "sha256:b24b8982ed444378d7f21d563f4180a2de31ced9d8d84443907a0a64da2072e7"}, + {file = "tornado-6.4.1.tar.gz", hash = "sha256:92d3ab53183d8c50f8204a51e6f91d18a15d5ef261e84d452800d4ff6fc504e9"}, ] [[package]] name = "tqdm" -version = "4.66.2" +version = "4.66.4" description = "Fast, Extensible Progress Meter" optional = false python-versions = ">=3.7" files = [ - {file = "tqdm-4.66.2-py3-none-any.whl", hash = "sha256:1ee4f8a893eb9bef51c6e35730cebf234d5d0b6bd112b0271e10ed7c24a02bd9"}, - {file = "tqdm-4.66.2.tar.gz", hash = "sha256:6cd52cdf0fef0e0f543299cfc96fec90d7b8a7e88745f411ec33eb44d5ed3531"}, + {file = "tqdm-4.66.4-py3-none-any.whl", hash = "sha256:b75ca56b413b030bc3f00af51fd2c1a1a5eac6a0c1cca83cbb37a5c52abce644"}, + {file = "tqdm-4.66.4.tar.gz", hash = "sha256:e4d936c9de8727928f3be6079590e97d9abfe8d39a590be678eb5919ffc186bb"}, ] [package.dependencies] @@ -5101,17 +5230,17 @@ test = ["argcomplete (>=3.0.3)", "mypy (>=1.7.0)", "pre-commit", "pytest (>=7.0, [[package]] name = "triton" -version = "2.3.0" +version = "2.3.1" description = "A language and compiler for custom Deep Learning operations" optional = false python-versions = "*" files = [ - {file = "triton-2.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ce4b8ff70c48e47274c66f269cce8861cf1dc347ceeb7a67414ca151b1822d8"}, - {file = "triton-2.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c3d9607f85103afdb279938fc1dd2a66e4f5999a58eb48a346bd42738f986dd"}, - {file = "triton-2.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:218d742e67480d9581bafb73ed598416cc8a56f6316152e5562ee65e33de01c0"}, - {file = "triton-2.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:381ec6b3dac06922d3e4099cfc943ef032893b25415de295e82b1a82b0359d2c"}, - {file = "triton-2.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:038e06a09c06a164fef9c48de3af1e13a63dc1ba3c792871e61a8e79720ea440"}, - {file = "triton-2.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6d8f636e0341ac348899a47a057c3daea99ea7db31528a225a3ba4ded28ccc65"}, + {file = "triton-2.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3c84595cbe5e546b1b290d2a58b1494df5a2ef066dd890655e5b8a8a92205c33"}, + {file = "triton-2.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c9d64ae33bcb3a7a18081e3a746e8cf87ca8623ca13d2c362413ce7a486f893e"}, + {file = "triton-2.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eaf80e8761a9e3498aa92e7bf83a085b31959c61f5e8ac14eedd018df6fccd10"}, + {file = "triton-2.3.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b13bf35a2b659af7159bf78e92798dc62d877aa991de723937329e2d382f1991"}, + {file = "triton-2.3.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:63381e35ded3304704ea867ffde3b7cfc42c16a55b3062d41e017ef510433d66"}, + {file = "triton-2.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1d968264523c7a07911c8fb51b4e0d1b920204dae71491b1fe7b01b62a31e124"}, ] [package.dependencies] @@ -5157,13 +5286,13 @@ files = [ [[package]] name = "typing-extensions" -version = "4.11.0" +version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.11.0-py3-none-any.whl", hash = "sha256:c1f94d72897edaf4ce775bb7558d5b79d8126906a14ea5ed1635921406c0387a"}, - {file = "typing_extensions-4.11.0.tar.gz", hash = "sha256:83f085bd5ca59c80295fc2a82ab5dac679cbe02b9f33f7d83af68e241bea51b0"}, + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [[package]] @@ -5249,13 +5378,13 @@ test = ["pytest (>=6.0.0)", "setuptools (>=65)"] [[package]] name = "widgetsnbextension" -version = "4.0.10" +version = "4.0.11" description = "Jupyter interactive widgets for Jupyter Notebook" optional = false python-versions = ">=3.7" files = [ - {file = "widgetsnbextension-4.0.10-py3-none-any.whl", hash = "sha256:d37c3724ec32d8c48400a435ecfa7d3e259995201fbefa37163124a9fcb393cc"}, - {file = "widgetsnbextension-4.0.10.tar.gz", hash = "sha256:64196c5ff3b9a9183a8e699a4227fb0b7002f252c814098e66c4d1cd0644688f"}, + {file = "widgetsnbextension-4.0.11-py3-none-any.whl", hash = "sha256:55d4d6949d100e0d08b94948a42efc3ed6dfdc0e9468b2c4b128c9a2ce3a7a36"}, + {file = "widgetsnbextension-4.0.11.tar.gz", hash = "sha256:8b22a8f1910bfd188e596fe7fc05dcbd87e810c8a4ba010bdb3da86637398474"}, ] [[package]] @@ -5356,18 +5485,18 @@ files = [ [[package]] name = "zipp" -version = "3.18.1" +version = "3.19.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.18.1-py3-none-any.whl", hash = "sha256:206f5a15f2af3dbaee80769fb7dc6f249695e940acca08dfb2a4769fe61e538b"}, - {file = "zipp-3.18.1.tar.gz", hash = "sha256:2884ed22e7d8961de1c9a05142eb69a247f120291bc0206a00a7642f09b5b715"}, + {file = "zipp-3.19.2-py3-none-any.whl", hash = "sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c"}, + {file = "zipp-3.19.2.tar.gz", hash = "sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [extras] qinfo = [] @@ -5377,4 +5506,4 @@ torch = ["torch"] [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.13" -content-hash = "c96177091d8cbe08f1791d4962a7b638d185e2cd35bff80e8afc7a239e4ae6b3" +content-hash = "8e08af9af1dbb26d97fcb75be806be99ea4cc2619a6c986c48f627d3b7d9541a" diff --git a/pyproject.toml b/pyproject.toml index 529231632d..d9d231acb6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "qibo" -version = "0.2.8" +version = "0.2.9" description = "A framework for quantum computing with hardware acceleration." authors = ["The Qibo team"] license = "Apache License 2.0" @@ -55,6 +55,8 @@ sphinx-markdown-tables = "^0.0.17" sphinx-copybutton = "^0.5.2" nbsphinx = "^0.8.12" ipython = "^8.10.0" +seaborn = "^0.13.2" +ipykernel = "^6.29.4" [tool.poetry.group.tests] optional = true @@ -65,7 +67,7 @@ cirq = "^1.1.0" ply = "^3.11" scikit-learn = "^1.2.1" pytest-cov = "^4.0.0" -pylint = "^3.1.0" +pylint = "3.1.0" matplotlib = "^3.7.0" tensorflow = { version = "^2.16.1", markers = "sys_platform == 'linux'" } torch = "^2.1.1" @@ -82,6 +84,7 @@ docs-clean = "make -C doc clean" test-docs = "make -C doc doctest" + [tool.poetry.group.cuda11] optional = true @@ -91,6 +94,7 @@ cuquantum-python-cu11 = "^23.3.0" qibojit = { git = "https://github.com/qiboteam/qibojit.git" } qibotn = { git = "https://github.com/qiboteam/qibotn.git" } + [tool.poetry.group.cuda12] optional = true diff --git a/src/qibo/__init__.py b/src/qibo/__init__.py index b895e37b0f..bcd912f1cc 100644 --- a/src/qibo/__init__.py +++ b/src/qibo/__init__.py @@ -14,10 +14,12 @@ solvers, ) from qibo.backends import ( + construct_backend, get_backend, get_device, get_precision, get_threads, + list_available_backends, matrices, set_backend, set_device, diff --git a/src/qibo/backends/__init__.py b/src/qibo/backends/__init__.py index a80c9932e1..a3dd66c2c6 100644 --- a/src/qibo/backends/__init__.py +++ b/src/qibo/backends/__init__.py @@ -1,4 +1,7 @@ import os +from importlib import import_module + +import numpy as np from qibo.backends.abstract import Backend from qibo.backends.clifford import CliffordBackend @@ -8,66 +11,51 @@ from qibo.backends.tensorflow import TensorflowBackend from qibo.config import log, raise_error - -def construct_backend(backend, **kwargs): - if backend == "qibojit": - from qibojit.backends import CupyBackend, CuQuantumBackend, NumbaBackend - - platform = kwargs.get("platform") - if platform == "cupy": # pragma: no cover - return CupyBackend() - elif platform == "cuquantum": # pragma: no cover - return CuQuantumBackend() - elif platform == "numba": - return NumbaBackend() - else: # pragma: no cover +QIBO_NATIVE_BACKENDS = ("numpy", "tensorflow", "pytorch") +QIBO_NON_NATIVE_BACKENDS = ("qibojit", "qibolab", "qibo-cloud-backends", "qibotn") + + +class MetaBackend: + """Meta-backend class which takes care of loading the qibo backends.""" + + @staticmethod + def load(backend: str, **kwargs) -> Backend: + """Loads the native qibo backend. + + Args: + backend (str): Name of the backend to load. + kwargs (dict): Additional arguments for the qibo backend. + Returns: + qibo.backends.abstract.Backend: The loaded backend. + """ + + if backend == "numpy": + return NumpyBackend() + elif backend == "tensorflow": + return TensorflowBackend() + elif backend == "pytorch": + return PyTorchBackend() + elif backend == "clifford": + engine = kwargs.pop("platform", None) + kwargs["engine"] = engine + return CliffordBackend(**kwargs) + else: + raise_error( + ValueError, + f"Backend {backend} is not available. The native qibo backends are {QIBO_NATIVE_BACKENDS}.", + ) + + def list_available(self) -> dict: + """Lists all the available native qibo backends.""" + available_backends = {} + for backend in QIBO_NATIVE_BACKENDS: try: - return CupyBackend() - except (ModuleNotFoundError, ImportError): - return NumbaBackend() - - elif backend == "tensorflow": - return TensorflowBackend() - - elif backend == "pytorch": - return PyTorchBackend() - - elif backend == "numpy": - return NumpyBackend() - - elif backend == "qibolab": # pragma: no cover - from qibolab.backends import QibolabBackend # pylint: disable=E0401 - - return QibolabBackend(**kwargs) - - elif backend == "qibotn": # pragma: no cover - - platform = kwargs.get("platform") - if platform == "cutensornet": # pragma: no cover - from qibotn.backends.cutensornet import CuTensorNet # pylint: disable=E0401 - - return CuTensorNet(kwargs["runcard"]) - elif platform == "qutensornet": # pragma: no cover - from qibotn.backends.quimb import QuimbBackend # pylint: disable=E0401 - - return QuimbBackend(kwargs["runcard"]) - - elif backend == "clifford": - return CliffordBackend(kwargs["platform"]) - elif backend == "qibo-client": # pragma: no cover - from qibo_cloud_backends.qibo_client import ( # pylint: disable=E0401 - QiboClientBackend, - ) - - return QiboClientBackend(**kwargs) - elif backend == "qiskit": # pragma: no cover - from qibo_cloud_backends.qiskit_client import ( # pylint: disable=E0401 - QiskitClientBackend, - ) - - return QiskitClientBackend(**kwargs) - else: # pragma: no cover - raise_error(ValueError, f"Backend {backend} is not available.") + MetaBackend.load(backend) + available = True + except: # pragma: no cover + available = False + available_backends[backend] = available + return available_backends class GlobalBackend(NumpyBackend): @@ -145,6 +133,7 @@ def create(self, dtype): self.ECR = self.matrices.ECR self.SYC = self.matrices.SYC self.TOFFOLI = self.matrices.TOFFOLI + self.CCZ = self.matrices.CCZ matrices = QiboMatrices() @@ -200,3 +189,63 @@ def _check_backend(backend): return GlobalBackend() return backend + + +def list_available_backends() -> dict: + """Lists all the backends that are available.""" + available_backends = MetaBackend().list_available() + for backend in QIBO_NON_NATIVE_BACKENDS: + try: + module = import_module(backend.replace("-", "_")) + available = getattr(module, "MetaBackend")().list_available() + except: + available = False + available_backends.update({backend: available}) + return available_backends + + +def construct_backend(backend, **kwargs) -> Backend: + """Construct a generic native or non-native qibo backend. + Args: + backend (str): Name of the backend to load. + kwargs (dict): Additional arguments for constructing the backend. + Returns: + qibo.backends.abstract.Backend: The loaded backend. + + """ + if backend in QIBO_NATIVE_BACKENDS + ("clifford",): + return MetaBackend.load(backend, **kwargs) + elif backend in QIBO_NON_NATIVE_BACKENDS: + module = import_module(backend.replace("-", "_")) + return getattr(module, "MetaBackend").load(**kwargs) + else: + raise_error( + ValueError, + f"Backend {backend} is not available. To check which backends are installed use `qibo.list_available_backends()`.", + ) + + +def _check_backend_and_local_state(seed, backend): + if ( + seed is not None + and not isinstance(seed, int) + and not isinstance(seed, np.random.Generator) + ): + raise_error( + TypeError, "seed must be either type int or numpy.random.Generator." + ) + + backend = _check_backend(backend) + + if seed is None or isinstance(seed, int): + if backend.__class__.__name__ in [ + "CupyBackend", + "CuQuantumBackend", + ]: # pragma: no cover + local_state = backend.np.random.default_rng(seed) + else: + local_state = np.random.default_rng(seed) + else: + local_state = seed + + return backend, local_state diff --git a/src/qibo/backends/npmatrices.py b/src/qibo/backends/npmatrices.py index c6e447e9ea..e1c1767a0f 100644 --- a/src/qibo/backends/npmatrices.py +++ b/src/qibo/backends/npmatrices.py @@ -64,7 +64,7 @@ def I(self, n=2): # _cast will take care of casting in the right dtype for all the backends return self._cast(self.np.eye(n, dtype=complex), dtype=self.dtype) - def Align(self, n=2): + def Align(self, delay, n=2): return self._cast(self.I(n), dtype=self.dtype) def M(self): # pragma: no cover @@ -446,6 +446,22 @@ def TOFFOLI(self): dtype=self.dtype, ) + @cached_property + def CCZ(self): + return self._cast( + [ + [1, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0, 0, 0], + [0, 0, 0, 1, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, -1], + ], + dtype=self.dtype, + ) + def DEUTSCH(self, theta): sin = self.np.sin(theta) + 0j # 0j necessary for right tensorflow dtype cos = self.np.cos(theta) + 0j diff --git a/src/qibo/backends/numpy.py b/src/qibo/backends/numpy.py index c29bf91ea8..f280a05640 100644 --- a/src/qibo/backends/numpy.py +++ b/src/qibo/backends/numpy.py @@ -2,6 +2,7 @@ import math import numpy as np +from scipy import sparse from qibo import __version__ from qibo.backends import einsum_utils @@ -119,7 +120,8 @@ def matrix_parametrized(self, gate): def matrix_fused(self, fgate): rank = len(fgate.target_qubits) - matrix = np.eye(2**rank) + matrix = sparse.eye(2**rank) + for gate in fgate.gates: # transfer gate matrix to numpy as it is more efficient for # small tensor calculations @@ -141,8 +143,10 @@ def matrix_fused(self, fgate): gmatrix = np.transpose(gmatrix, transpose_indices) gmatrix = np.reshape(gmatrix, original_shape) # fuse the individual gate matrix to the total ``FusedGate`` matrix - matrix = gmatrix @ matrix - return self.cast(matrix) + # we are using sparse matrices to improve perfomances + matrix = sparse.csr_matrix(gmatrix).dot(matrix) + + return self.cast(matrix.toarray()) def control_matrix(self, gate): if len(gate.control_qubits) > 1: @@ -641,19 +645,23 @@ def aggregate_shots(self, shots): return self.cast(shots, dtype=shots[0].dtype) def samples_to_binary(self, samples, nqubits): - qrange = self.np.arange(nqubits - 1, -1, -1, dtype=self.np.int32) - return self.np.mod( - self.np.right_shift(self.cast(samples[:, None], dtype="int32"), qrange), 2 - ) + ### This is faster just staying @ NumPy. + qrange = np.arange(nqubits - 1, -1, -1, dtype=np.int32) + samples = self.to_numpy(samples) + return np.mod(np.right_shift(samples[:, None], qrange), 2) def samples_to_decimal(self, samples, nqubits): - qrange = self.np.arange(nqubits - 1, -1, -1, dtype=self.np.int32) + ### This is faster just staying @ NumPy. + qrange = np.arange(nqubits - 1, -1, -1, dtype=np.int32) qrange = (2**qrange)[:, None] - return self.np.matmul(samples, qrange)[:, 0] + samples = np.asarray(samples.tolist()) + return np.matmul(samples, qrange)[:, 0] def calculate_frequencies(self, samples): # Samples are a list of strings so there is no advantage in using other backends res, counts = np.unique(samples, return_counts=True) + res = self.to_numpy(res).tolist() + counts = self.to_numpy(counts).tolist() return collections.Counter(dict(zip(res, counts))) def update_frequencies(self, frequencies, probabilities, nsamples): @@ -677,6 +685,7 @@ def sample_frequencies(self, probabilities, nshots): ) def apply_bitflips(self, noiseless_samples, bitflip_probabilities): + noiseless_samples = self.cast(noiseless_samples, dtype=noiseless_samples.dtype) fprobs = self.cast(bitflip_probabilities, dtype="float64") sprobs = self.cast(np.random.random(noiseless_samples.shape), dtype="float64") flip_0 = self.cast(sprobs < fprobs[0], dtype=noiseless_samples.dtype) diff --git a/src/qibo/backends/tensorflow.py b/src/qibo/backends/tensorflow.py index f762b0e66c..3d10da18f6 100644 --- a/src/qibo/backends/tensorflow.py +++ b/src/qibo/backends/tensorflow.py @@ -32,9 +32,13 @@ def __init__(self): super().__init__() self.name = "tensorflow" os.environ["TF_CPP_MIN_LOG_LEVEL"] = str(TF_LOG_LEVEL) + import tensorflow as tf # pylint: disable=import-error import tensorflow.experimental.numpy as tnp # pylint: disable=import-error + if TF_LOG_LEVEL >= 2: + tf.get_logger().setLevel("ERROR") + tnp.experimental_enable_numpy_behavior() self.tf = tf self.np = tnp diff --git a/src/qibo/gates/gates.py b/src/qibo/gates/gates.py index dfbe628a00..54b02b45f2 100644 --- a/src/qibo/gates/gates.py +++ b/src/qibo/gates/gates.py @@ -503,16 +503,16 @@ def qasm_label(self): return "id" -class Align(Gate): +class Align(ParametrizedGate): """Aligns proceeding qubit operations and (optionally) waits ``delay`` amount of time. Args: - *q (int): The qubit ID numbers. + q (int): The qubit ID. delay (int, optional): The time (in ns) for which to delay circuit execution on the specified qubits. Defaults to ``0`` (zero). """ - def __init__(self, *q, delay: int = 0): + def __init__(self, q, delay=0, trainable=True): if not isinstance(delay, int): raise_error( TypeError, f"delay must be type int, but it is type {type(delay)}." @@ -520,13 +520,14 @@ def __init__(self, *q, delay: int = 0): if delay < 0.0: raise_error(ValueError, "Delay must not be negative.") - super().__init__() + super().__init__(trainable) self.name = "align" - self.delay = delay self.draw_label = f"A({delay})" - self.init_args = q - self.init_kwargs = {"delay": delay} - self.target_qubits = tuple(q) + self.init_args = [q] + self.init_kwargs = {"name": self.name, "delay": delay, "trainable": trainable} + self.target_qubits = (q,) + self._parameters = (delay,) + self.nparams = 1 def _is_clifford_given_angle(angle): @@ -2307,6 +2308,56 @@ def congruent(self, use_toffolis: bool = True) -> List[Gate]: ] +class CCZ(Gate): + """The controlled-CZ gate. + + Corresponds to the following unitary matrix + + .. math:: + \\begin{pmatrix} + 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\\\ + 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\\\ + 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\\\ + 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\\\ + 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\\\ + 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\\\ + 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\\\ + 0 & 0 & 0 & 0 & 0 & 0 & 0 & -1 \\\\ + \\end{pmatrix} + + Args: + q0 (int): the first control qubit id number. + q1 (int): the second control qubit id number. + q2 (int): the target qubit id number. + """ + + def __init__(self, q0, q1, q2): + super().__init__() + self.name = "ccz" + self.draw_label = "Z" + self.control_qubits = (q0, q1) + self.target_qubits = (q2,) + self.init_args = [q0, q1, q2] + self.unitary = True + + @property + def qasm_label(self): + return "ccz" + + def decompose(self) -> List[Gate]: + """Decomposition of :math:`\\text{CCZ}` gate. + + Decompose :math:`\\text{CCZ}` gate into :class:`qibo.gates.H` in + the target qubit, followed by :class:`qibo.gates.TOFFOLI`, followed + by a :class:`qibo.gates.H` in the target qubit. + """ + from qibo.transpiler.decompositions import ( # pylint: disable=C0415 + standard_decompositions, + ) + + return standard_decompositions(self) + + class DEUTSCH(ParametrizedGate): """The Deutsch gate. diff --git a/src/qibo/models/dbi/double_bracket.py b/src/qibo/models/dbi/double_bracket.py index 435e4236d6..e2f8d9b7f2 100644 --- a/src/qibo/models/dbi/double_bracket.py +++ b/src/qibo/models/dbi/double_bracket.py @@ -1,11 +1,17 @@ from copy import deepcopy from enum import Enum, auto -from functools import partial +from typing import Optional -import hyperopt import numpy as np from qibo.hamiltonians import Hamiltonian +from qibo.models.dbi.utils import * +from qibo.models.dbi.utils_scheduling import ( + grid_search_step, + hyperopt_step, + polynomial_step, + simulated_annealing_step, +) class DoubleBracketGeneratorType(Enum): @@ -17,7 +23,36 @@ class DoubleBracketGeneratorType(Enum): """Use single commutator.""" group_commutator = auto() """Use group commutator approximation""" - # TODO: add double commutator (does it converge?) + group_commutator_third_order = auto() + """Implements: $e^{\frac{\\sqrt{5}-1}{2}isH}e^{\frac{\\sqrt{5}-1}{2}isD}e^{-isH}e^{isD}e^{\frac{3-\\sqrt{5}}{2}isH}e^{isD} + \approx e^{-s^2[H,D]} + O(s^4)$ + which is equation (8) in https://arxiv.org/abs/2111.12177] + s must be taken as $\\sqrt{s}$ to approximate the flow using the commutator + """ + + +class DoubleBracketCostFunction(str, Enum): + """Define the DBI cost function.""" + + off_diagonal_norm = "off_diagonal_norm" + """Use off-diagonal norm as cost function.""" + least_squares = "least_squares" + """Use least squares as cost function.""" + energy_fluctuation = "energy_fluctuation" + """Use energy fluctuation as cost function.""" + + +class DoubleBracketScheduling(Enum): + """Define the DBI scheduling strategies.""" + + hyperopt = hyperopt_step + """Use hyperopt package.""" + grid_search = grid_search_step + """Use greedy grid search.""" + polynomial_approximation = polynomial_step + """Use polynomial expansion (analytical) of the loss function.""" + simulated_annealing = simulated_annealing_step + """Use simulated annealing algorithm""" class DoubleBracketIteration: @@ -48,28 +83,52 @@ def __init__( self, hamiltonian: Hamiltonian, mode: DoubleBracketGeneratorType = DoubleBracketGeneratorType.canonical, + scheduling: DoubleBracketScheduling = DoubleBracketScheduling.grid_search, + cost: DoubleBracketCostFunction = DoubleBracketCostFunction.off_diagonal_norm, + ref_state: np.array = None, ): self.h = hamiltonian self.h0 = deepcopy(self.h) self.mode = mode + self.scheduling = scheduling + self.cost = cost + self.ref_state = ref_state + """ + Args: + hamiltonian (Hamiltonian): Starting Hamiltonian; + mode (DoubleBracketGeneratorType): type of generator of the evolution. + scheduling (DoubleBracketScheduling): type of scheduling strategy. + cost (DoubleBracketCost): type of cost function. + ref_state (np.array): reference state for computing the energy fluctuation. + """ def __call__( self, step: float, mode: DoubleBracketGeneratorType = None, d: np.array = None ): - r"""We use convention that $H' = U^\dagger H U$ where $U=e^{-sW}$ with $W=[D,H]$ (or depending on `mode` an approximation, see `eval_dbr_unitary`). If $s>0$ then for $D = \Delta(H)$ the GWW DBR will give a $\sigma$-decrease, see https://arxiv.org/abs/2206.11772.""" + r"""We use convention that $H' = U^\dagger H U$ where $U=e^{-sW}$ with $W=[D,H]$ + (or depending on `mode` an approximation, see `eval_dbr_unitary`). + If $s>0$ then for $D = \Delta(H)$ the GWW DBR will give a $\sigma$-decrease, + see https://arxiv.org/abs/2206.11772.""" operator = self.eval_dbr_unitary(step, mode, d) operator_dagger = self.backend.cast( - np.matrix(self.backend.to_numpy(operator)).getH() + np.array(np.matrix(self.backend.to_numpy(operator)).getH()) ) self.h.matrix = operator_dagger @ self.h.matrix @ operator return operator def eval_dbr_unitary( - self, step: float, mode: DoubleBracketGeneratorType = None, d: np.array = None + self, + step: float, + mode: DoubleBracketGeneratorType = None, + d: np.array = None, ): - """In call we will are working in the convention that $H' = U^\\dagger H U$ where $U=e^{-sW}$ with $W=[D,H]$ or an approximation of that by a group commutator. That is handy because if we switch from the DBI in the Heisenberg picture for the Hamiltonian, we get that the transformation of the state is $|\\psi'\rangle = U |\\psi\rangle$ so that $\\langle H\rangle_{\\psi'} = \\langle H' \rangle_\\psi$ (i.e. when writing the unitary acting on the state dagger notation is avoided). - + """In call we are working in the convention that $H' = U^\\dagger H + U$ where $U=e^{-sW}$ with $W=[D,H]$ or an approximation of that by a group commutator. + That is handy because if we switch from the DBI in the Heisenberg picture for the + Hamiltonian, we get that the transformation of the state is $|\\psi'\rangle = U |\\psi\rangle$ + so that $\\langle H\rangle_{\\psi'} = \\langle H' \rangle_\\psi$ (i.e. when writing the unitary + acting on the state dagger notation is avoided). The group commutator must approximate $U=e^{-s[D,H]}$. This is achieved by setting $r = \\sqrt{s}$ so that $$V = e^{-irH}e^{irD}e^{irH}e^{-irD}$$ because @@ -91,19 +150,41 @@ def eval_dbr_unitary( d = self.diagonal_h_matrix operator = self.backend.calculate_matrix_exp( -1.0j * step, - self.commutator(d, self.h.matrix), + self.commutator(self.backend.cast(d), self.h.matrix), ) elif mode is DoubleBracketGeneratorType.group_commutator: if d is None: d = self.diagonal_h_matrix - - sqrt_step = np.sqrt(step) operator = ( - self.h.exp(sqrt_step) - @ self.backend.calculate_matrix_exp(-sqrt_step, d) - @ self.h.exp(-sqrt_step) - @ self.backend.calculate_matrix_exp(sqrt_step, d) + self.h.exp(step) + @ self.backend.calculate_matrix_exp(-step, d) + @ self.h.exp(-step) + @ self.backend.calculate_matrix_exp(step, d) ) + elif mode is DoubleBracketGeneratorType.group_commutator_third_order: + if d is None: + d = self.diagonal_h_matrix + operator = ( + self.h.exp(-step * (np.sqrt(5) - 1) / 2) + @ self.backend.calculate_matrix_exp(-step * (np.sqrt(5) - 1) / 2, d) + @ self.h.exp(step) + @ self.backend.calculate_matrix_exp(step * (np.sqrt(5) + 1) / 2, d) + @ self.h.exp(-step * (3 - np.sqrt(5)) / 2) + @ self.backend.calculate_matrix_exp(-step, d) + ) + operator = ( + self.backend.calculate_matrix_exp(step, d) + @ self.h.exp(step * (3 - np.sqrt(5)) / 2) + @ self.backend.calculate_matrix_exp(-step * (np.sqrt(5) + 1) / 2, d) + @ self.h.exp(-step) + @ self.backend.calculate_matrix_exp(step * (np.sqrt(5) - 1) / 2, d) + @ self.h.exp(step * (np.sqrt(5) - 1) / 2) + ) + else: + raise NotImplementedError( + f"The mode {mode} is not supported" + ) # pragma: no cover + return operator @staticmethod @@ -118,11 +199,12 @@ def diagonal_h_matrix(self): @property def off_diag_h(self): + """Off-diagonal H matrix.""" return self.h.matrix - self.diagonal_h_matrix @property def off_diagonal_norm(self): - r"""Hilbert Schmidt norm of off-diagonal part of H matrix, namely :math:`\\text{Tr}(\\sqrt{A^{\\dagger} A})`.""" + """Hilbert Schmidt norm of off-diagonal part of H matrix, namely :math:`\\text{Tr}(\\sqrt{A^{\\dagger} A})`.""" off_diag_h_dag = self.backend.cast( np.matrix(self.backend.to_numpy(self.off_diag_h)).getH() ) @@ -135,56 +217,49 @@ def backend(self): """Get Hamiltonian's backend.""" return self.h0.backend - def hyperopt_step( + @property + def nqubits(self): + """Number of qubits.""" + return self.h.nqubits + + def least_squares(self, d: np.array): + """Least squares cost function.""" + d = self.backend.to_numpy(d) + return np.real( + 0.5 * np.linalg.norm(d) ** 2 + - np.trace(self.backend.to_numpy(self.h.matrix) @ d) + ) + + def choose_step( self, - step_min: float = 1e-5, - step_max: float = 1, - max_evals: int = 1000, - space: callable = None, - optimizer: callable = None, - look_ahead: int = 1, - verbose: bool = False, - d: np.array = None, + d: Optional[np.array] = None, + scheduling: Optional[DoubleBracketScheduling] = None, + **kwargs, ): - """ - Optimize iteration step. - - Args: - step_min: lower bound of the search grid; - step_max: upper bound of the search grid; - max_evals: maximum number of iterations done by the hyperoptimizer; - space: see hyperopt.hp possibilities; - optimizer: see hyperopt algorithms; - look_ahead: number of iteration steps to compute the loss function; - verbose: level of verbosity; - d: diagonal operator for generating double-bracket iterations. - - Returns: - (float): optimized best iteration step. - """ - if space is None: - space = hyperopt.hp.uniform - if optimizer is None: - optimizer = hyperopt.tpe - - space = space("step", step_min, step_max) - best = hyperopt.fmin( - fn=partial(self.loss, d=d, look_ahead=look_ahead), - space=space, - algo=optimizer.suggest, - max_evals=max_evals, - verbose=verbose, - ) - return best["step"] + """Calculate the optimal step using respective the `scheduling` methods.""" + if scheduling is None: + scheduling = self.scheduling + step = scheduling(self, d=d, **kwargs) + # TODO: write test for this case + if ( + step is None + and scheduling is DoubleBracketScheduling.polynomial_approximation + ): # pragma: no cover + kwargs["n"] = kwargs.get("n", 3) + kwargs["n"] += 1 + # if n==n_max, return None + step = scheduling(self, d=d, **kwargs) + # if for a given polynomial order n, no solution is found, we increase the order of the polynomial by 1 + return step def loss(self, step: float, d: np.array = None, look_ahead: int = 1): """ Compute loss function distance between `look_ahead` steps. Args: - step: iteration step. - d: diagonal operator, use canonical by default. - look_ahead: number of iteration steps to compute the loss function; + step (float): iteration step. + d (np.array): diagonal operator, use canonical by default. + look_ahead (int): number of iteration steps to compute the loss function; """ # copy initial hamiltonian h_copy = deepcopy(self.h) @@ -192,8 +267,13 @@ def loss(self, step: float, d: np.array = None, look_ahead: int = 1): for _ in range(look_ahead): self.__call__(mode=self.mode, step=step, d=d) - # off_diagonal_norm's value after the steps - loss = self.off_diagonal_norm + # loss values depending on the cost function + if self.cost is DoubleBracketCostFunction.off_diagonal_norm: + loss = self.off_diagonal_norm + elif self.cost is DoubleBracketCostFunction.least_squares: + loss = self.least_squares(d) + elif self.cost == DoubleBracketCostFunction.energy_fluctuation: + loss = self.energy_fluctuation(self.ref_state) # set back the initial configuration self.h = h_copy @@ -202,10 +282,10 @@ def loss(self, step: float, d: np.array = None, look_ahead: int = 1): def energy_fluctuation(self, state): """ - Evaluate energy fluctuation + Evaluate energy fluctuation. .. math:: - \\Xi_{k}(\\mu) = \\sqrt{\\langle\\mu|\\hat{H}^2|\\mu\\rangle - \\langle\\mu|\\hat{H}|\\mu\\rangle^2} \\, + \\Xi(\\mu) = \\sqrt{\\langle\\mu|\\hat{H}^2|\\mu\\rangle - \\langle\\mu|\\hat{H}|\\mu\\rangle^2} \\, for a given state :math:`|\\mu\\rangle`. @@ -213,3 +293,32 @@ def energy_fluctuation(self, state): state (np.ndarray): quantum state to be used to compute the energy fluctuation with H. """ return self.h.energy_fluctuation(state) + + def sigma(self, h: np.array): + """Returns the off-diagonal restriction of matrix `h`.""" + return self.backend.cast(h) - self.backend.cast( + np.diag(np.diag(self.backend.to_numpy(h))) + ) + + def generate_gamma_list(self, n: int, d: np.array): + r"""Computes the n-nested Gamma functions, where $\Gamma_k=[W,...,[W,[W,H]]...]$, where we take k nested commutators with $W = [D, H]$""" + W = self.commutator(self.backend.cast(d), self.sigma(self.h.matrix)) + gamma_list = [self.h.matrix] + for _ in range(n - 1): + gamma_list.append(self.commutator(W, gamma_list[-1])) + return gamma_list + + def cost_expansion(self, d, n): + d = self.backend.cast(d) + + if self.cost is DoubleBracketCostFunction.off_diagonal_norm: + coef = off_diagonal_norm_polynomial_expansion_coef(self, d, n) + elif self.cost is DoubleBracketCostFunction.least_squares: + coef = least_squares_polynomial_expansion_coef(self, d, n) + elif self.cost is DoubleBracketCostFunction.energy_fluctuation: + coef = energy_fluctuation_polynomial_expansion_coef( + self, d, n, self.ref_state + ) + else: # pragma: no cover + raise ValueError(f"Cost function {self.cost} not recognized.") + return coef diff --git a/src/qibo/models/dbi/utils.py b/src/qibo/models/dbi/utils.py index 79bb41db7c..10367d71f9 100644 --- a/src/qibo/models/dbi/utils.py +++ b/src/qibo/models/dbi/utils.py @@ -1,17 +1,12 @@ -from copy import deepcopy -from itertools import product -from typing import Optional +import math +from enum import Enum, auto +from itertools import combinations, product import numpy as np -from hyperopt import hp, tpe from qibo import symbols from qibo.backends import _check_backend from qibo.hamiltonians import SymbolicHamiltonian -from qibo.models.dbi.double_bracket import ( - DoubleBracketGeneratorType, - DoubleBracketIteration, -) def generate_Z_operators(nqubits: int, backend=None): @@ -71,96 +66,200 @@ def str_to_symbolic(name: str): return tensor_op -def select_best_dbr_generator( - dbi_object: DoubleBracketIteration, - d_list: list, - step: Optional[float] = None, - step_min: float = 1e-5, - step_max: float = 1, - max_evals: int = 200, - compare_canonical: bool = True, +def cs_angle_sgn(dbi_object, d): + """Calculates the sign of Cauchy-Schwarz Angle :math:`\\langle W(Z), W({\\rm canonical}) \\rangle_{\\rm HS}`.""" + d = dbi_object.backend.cast(d) + norm = np.trace( + np.dot( + np.conjugate( + dbi_object.commutator(dbi_object.diagonal_h_matrix, dbi_object.h.matrix) + ).T, + dbi_object.commutator(d, dbi_object.h.matrix), + ) + ) + return np.real(np.sign(norm)) + + +def decompose_into_pauli_basis(h_matrix: np.array, pauli_operators: list): + """finds the decomposition of hamiltonian `h_matrix` into Pauli-Z operators""" + nqubits = int(np.log2(h_matrix.shape[0])) + + decomposition = [] + for Z_i in pauli_operators: + expect = np.trace(h_matrix @ Z_i) / 2**nqubits + decomposition.append(expect) + return decomposition + + +def generate_pauli_index(nqubits, order): + """ + Generate all possible combinations of qubits for a given order of Pauli operators. + """ + if order == 1: + return list(range(nqubits)) + else: + indices = list(range(nqubits)) + return indices + [ + comb for i in range(2, order + 1) for comb in combinations(indices, i) + ] + + +def generate_pauli_operator_dict( + nqubits: int, + parameterization_order: int = 1, + symbols_pauli=symbols.Z, + backend=None, ): - """Selects the best double bracket rotation generator from a list and execute the rotation. + """Generates a dictionary containing Pauli `symbols_pauli` operators of locality `parameterization_order` for `nqubits` qubits. Args: - dbi_object (`DoubleBracketIteration`): the target DoubleBracketIteration object. - d_list (list): list of diagonal operators (np.array) to run from. - step (float): fixed iteration duration. - Defaults to ``None``, uses hyperopt. - step_min (float): minimally allowed iteration duration. - step_max (float): maximally allowed iteration duration. - max_evals (int): maximally allowed number of evaluation in hyperopt. - compare_canonical (bool): if `True`, the optimal diagonal operator chosen from "d_list" is compared with the canonical bracket. + nqubits (int): number of qubits in the system. + parameterization_order (int, optional): the locality of the operators generated. Defaults to 1. + symbols_pauli (qibo.symbols, optional): the symbol of the intended Pauli operator. Defaults to symbols.Z. Returns: - The updated dbi_object, index of the optimal diagonal operator, respective step duration, and evolution direction. + pauli_operator_dict (dictionary): dictionary with structure {"operator_name": operator} + + Example: + pauli_operator_dict = generate_pauli_operator_dict) """ - norms_off_diagonal_restriction = [ - dbi_object.off_diagonal_norm for _ in range(len(d_list)) + backend = _check_backend(backend) + pauli_index = generate_pauli_index(nqubits, order=parameterization_order) + pauli_operators = [ + generate_pauli_operators(nqubits, symbols_pauli, index, backend=backend) + for index in pauli_index ] - optimal_steps, flip_list = [], [] - for i, d in enumerate(d_list): - # prescribed step durations - dbi_eval = deepcopy(dbi_object) - flip_list.append(cs_angle_sgn(dbi_eval, d)) - if flip_list[i] != 0: - if step is None: - step_best = dbi_eval.hyperopt_step( - d=flip_list[i] * d, - step_min=step_min, - step_max=step_max, - space=hp.uniform, - optimizer=tpe, - max_evals=max_evals, - ) - else: - step_best = step - dbi_eval(step=step_best, d=flip_list[i] * d) - optimal_steps.append(step_best) - norms_off_diagonal_restriction[i] = dbi_eval.off_diagonal_norm - # canonical - if compare_canonical is True: - flip_list.append(1) - dbi_eval = deepcopy(dbi_object) - dbi_eval.mode = DoubleBracketGeneratorType.canonical - if step is None: - step_best = dbi_eval.hyperopt_step( - step_min=step_min, - step_max=step_max, - space=hp.uniform, - optimizer=tpe, - max_evals=max_evals, - ) - else: - step_best = step - dbi_object(step=step) - optimal_steps.append(step) - norms_off_diagonal_restriction.append(dbi_object.off_diagonal_norm) - # find best d - idx_max_loss = norms_off_diagonal_restriction.index( - min(norms_off_diagonal_restriction) - ) - flip = flip_list[idx_max_loss] - step_optimal = optimal_steps[idx_max_loss] - dbi_eval = deepcopy(dbi_object) - if idx_max_loss == len(d_list) and compare_canonical is True: - # canonical - dbi_eval(step=step_optimal, mode=DoubleBracketGeneratorType.canonical) + return {index: operator for index, operator in zip(pauli_index, pauli_operators)} + +def generate_pauli_operators(nqubits, symbols_pauli, positions, backend=None): + # generate matrix of an nqubit-pauli operator with `symbols_pauli` at `positions` + if isinstance(positions, int): + return SymbolicHamiltonian( + symbols_pauli(positions), + nqubits=nqubits, + backend=backend, + ).dense.matrix else: - d_optimal = flip * d_list[idx_max_loss] - dbi_eval(step=step_optimal, d=d_optimal) - return dbi_eval, idx_max_loss, step_optimal, flip + terms = [symbols_pauli(pos) for pos in positions] + return SymbolicHamiltonian( + math.prod(terms), nqubits=nqubits, backend=backend + ).dense.matrix -def cs_angle_sgn(dbi_object, d): - """Calculates the sign of Cauchy-Schwarz Angle :math:`\\langle W(Z), W({\\rm canonical}) \\rangle_{\\rm HS}`.""" - norm = np.trace( - np.dot( - np.conjugate( - dbi_object.commutator(dbi_object.diagonal_h_matrix, dbi_object.h.matrix) - ).T, - dbi_object.commutator(d, dbi_object.h.matrix), +class ParameterizationTypes(Enum): + """Define types of parameterization for diagonal operator.""" + + pauli = auto() + """Uses Pauli-Z operators (magnetic field).""" + computational = auto() + """Uses computational basis.""" + + +def params_to_diagonal_operator( + params: np.array, + nqubits: int, + parameterization: ParameterizationTypes = ParameterizationTypes.pauli, + pauli_parameterization_order: int = 1, + normalize: bool = False, + pauli_operator_dict: dict = None, + backend=None, +): + r"""Creates the $D$ operator for the double-bracket iteration ansatz depending on the parameterization type.""" + backend = _check_backend(backend) + if parameterization is ParameterizationTypes.pauli: + # raise error if dimension mismatch + d = sum( + [ + backend.to_numpy(params[i]) + * backend.to_numpy(list(pauli_operator_dict.values())[i]) + for i in range(nqubits) + ] + ) + elif parameterization is ParameterizationTypes.computational: + d = np.zeros((len(params), len(params))) + for i in range(len(params)): + d[i, i] = backend.to_numpy(params[i]) + + # TODO: write proper tests for normalize=True + if normalize: # pragma: no cover + d = d / np.linalg.norm(d) + return d + + +def off_diagonal_norm_polynomial_expansion_coef(dbi_object, d, n): + # generate Gamma's where $\Gamma_{k+1}=[W, \Gamma_{k}], $\Gamma_0=H + W = dbi_object.commutator( + dbi_object.backend.cast(d), dbi_object.sigma(dbi_object.h.matrix) + ) + gamma_list = dbi_object.generate_gamma_list(n + 2, d) + sigma_gamma_list = list(map(dbi_object.sigma, gamma_list)) + gamma_list_np = list(map(dbi_object.backend.to_numpy, sigma_gamma_list)) + exp_list = np.array([1 / math.factorial(k) for k in range(n + 1)]) + # coefficients for rotation with [W,H] and H + c1 = exp_list.reshape((-1, 1, 1)) * gamma_list_np[1:] + c2 = exp_list.reshape((-1, 1, 1)) * gamma_list_np[:-1] + # product coefficient + trace_coefficients = [0] * (2 * n + 1) + for k in range(n + 1): + for j in range(n + 1): + power = k + j + product_matrix = c1[k] @ c2[j] + trace_coefficients[power] += 2 * np.trace(product_matrix) + # coefficients from high to low (n:0) + coef = list(reversed(trace_coefficients[: n + 1])) + return coef + + +def least_squares_polynomial_expansion_coef(dbi_object, d, n: int = 3): + """Return the Taylor expansion coefficients of least square cost of `dbi_object.h` and diagonal operator `d` with respect to double bracket rotation duration `s`.""" + # generate Gamma's where $\Gamma_{k+1}=[W, \Gamma_{k}], $\Gamma_0=H + Gamma_list = dbi_object.generate_gamma_list(n + 1, d) + exp_list = np.array([1 / math.factorial(k) for k in range(n + 1)]) + # coefficients + coef = np.empty(n) + for i in range(n): + coef[i] = np.real( + exp_list[i] * np.trace(dbi_object.backend.cast(d) @ Gamma_list[i + 1]) ) + coef = list(reversed(coef)) + return coef + + +def energy_fluctuation_polynomial_expansion_coef( + dbi_object, d: np.array, n: int = 3, state=0 +): + """Return the Taylor expansion coefficients of energy fluctuation of `dbi_object` with respect to double bracket rotation duration `s`.""" + # generate Gamma's where $\Gamma_{k+1}=[W, \Gamma_{k}], $\Gamma_0=H + Gamma_list = dbi_object.generate_gamma_list(n + 1, d) + # coefficients + coef = np.empty(3) + state_cast = dbi_object.backend.cast(state) + state_dag = dbi_object.backend.cast(state.conj().T) + + def variance(a): + """Calculates the variance of a matrix A with respect to a state: + Var($A$) = $\\langle\\mu|A^2|\\mu\rangle-\\langle\\mu|A|\\mu\rangle^2$""" + b = a @ a + return state_dag @ b @ state_cast - (state_dag @ a @ state_cast) ** 2 + + def covariance(a, b): + """This is a generalization of the notion of covariance, needed for the polynomial expansion of the energy fluctuation, + applied to two operators A and B with respect to a state: + Cov($A,B$) = $\\langle\\mu|AB|\\mu\rangle-\\langle\\mu|A|\\mu\rangle\\langle\\mu|B|\\mu\rangle$ + """ + + c = a @ b + b @ a + return ( + state_dag @ c @ state_cast + - 2 * state_dag @ a @ state_cast * state_dag @ b @ state_cast + ) + + coef[0] = np.real(2 * covariance(Gamma_list[0], Gamma_list[1])) + coef[1] = np.real(2 * variance(Gamma_list[1])) + coef[2] = np.real( + covariance(Gamma_list[0], Gamma_list[3]) + + 3 * covariance(Gamma_list[1], Gamma_list[2]) ) - return np.sign(norm) + coef = list(reversed(coef)) + return coef diff --git a/src/qibo/models/dbi/utils_dbr_strategies.py b/src/qibo/models/dbi/utils_dbr_strategies.py new file mode 100644 index 0000000000..5aae761fde --- /dev/null +++ b/src/qibo/models/dbi/utils_dbr_strategies.py @@ -0,0 +1,299 @@ +import hyperopt + +from qibo.backends import _check_backend +from qibo.models.dbi.double_bracket import * +from qibo.models.dbi.utils import * + + +def select_best_dbr_generator( + dbi_object: DoubleBracketIteration, + d_list: list, + step: Optional[float] = None, + compare_canonical: bool = True, + scheduling: DoubleBracketScheduling = None, + **kwargs, +): + """Selects the best double bracket rotation generator from a list and execute the rotation. + + Args: + dbi_object (`DoubleBracketIteration`): the target DoubleBracketIteration object. + d_list (list): list of diagonal operators (np.array) to select from. + step (float): fixed iteration duration. + Defaults to ``None``, optimize with `scheduling` method and `choose_step` function. + compare_canonical (boolean): if `True`, the diagonalization effect with operators from `d_list` is compared with the canonical bracket. + scheduling (`DoubleBracketScheduling`): scheduling method for finding the optimal step. + + Returns: + The updated dbi_object (`DoubleBracketIteration`), index of the optimal diagonal operator (int), respective step duration (float), and sign (int). + + Example: + from qibo.hamiltonians import Hamiltonian + from qibo.models.dbi.double_bracket import * + from qibo.models.dbi.utils_dbr_strategies import select_best_dbr_generator + from qibo.quantum_info import random_hermitian + + nqubits = 3 + NSTEPS = 3 + h0 = random_hermitian(2**nqubits) + dbi = DoubleBracketIteration( + Hamiltonian(nqubits, h0), + mode=DoubleBracketGeneratorType.single_commutator, + ) + initial_off_diagonal_norm = dbi.off_diagonal_norm + generate_local_Z = generate_Z_operators(nqubits) + Z_ops = list(generate_local_Z.values()) + for _ in range(NSTEPS): + dbi, idx, step, flip_sign = select_best_dbr_generator( + dbi, Z_ops, compare_canonical=True + ) + """ + if scheduling is None: + scheduling = dbi_object.scheduling + + if compare_canonical: + norms_off_diagonal_restriction = [dbi_object.off_diagonal_norm] * ( + len(d_list) + 1 + ) + optimal_steps = np.zeros(len(d_list) + 1) + flip_list = np.ones(len(d_list) + 1) + else: + norms_off_diagonal_restriction = [dbi_object.off_diagonal_norm] * (len(d_list)) + optimal_steps = np.zeros(len(d_list)) + flip_list = np.ones(len(d_list)) + + for i, d in enumerate(d_list): + # prescribed step durations + dbi_eval = deepcopy(dbi_object) + d = dbi_eval.backend.cast(d) + flip_list[i] = cs_angle_sgn(dbi_eval, d) + if flip_list[i] != 0: + if step is None: + step_best = dbi_eval.choose_step( + d=flip_list[i] * d, scheduling=scheduling, **kwargs + ) + else: + step_best = step + dbi_eval(step=step_best, d=flip_list[i] * d) + optimal_steps[i] = step_best + norms_off_diagonal_restriction[i] = dbi_eval.off_diagonal_norm + # canonical + if compare_canonical is True: + dbi_eval = deepcopy(dbi_object) + dbi_eval.mode = DoubleBracketGeneratorType.canonical + if step is None: + step_best = dbi_eval.choose_step(scheduling=scheduling, **kwargs) + else: + step_best = step + dbi_eval(step=step_best) + optimal_steps[-1] = step_best + norms_off_diagonal_restriction[-1] = dbi_eval.off_diagonal_norm + # find best d + idx_max_loss = np.argmin(norms_off_diagonal_restriction) + flip = flip_list[idx_max_loss] + step_optimal = optimal_steps[idx_max_loss] + dbi_eval = deepcopy(dbi_object) + if idx_max_loss == len(d_list) and compare_canonical is True: + # canonical + dbi_eval(step=step_optimal, mode=DoubleBracketGeneratorType.canonical) + + else: + d_optimal = flip * d_list[idx_max_loss] + dbi_eval(step=step_optimal, d=d_optimal) + return dbi_eval, idx_max_loss, step_optimal, flip + + +def gradient_numerical( + dbi_object: DoubleBracketIteration, + d_params: list, + parameterization: ParameterizationTypes, + s: float = 1e-2, + delta: float = 1e-3, + backend=None, + **kwargs, +): + r""" + Gradient of the DBI with respect to the parametrization of D. A simple finite difference is used to calculate the gradient. + + Args: + dbi_object (DoubleBracketIteration): DoubleBracketIteration object. + d_params (np.array): Parameters for the ansatz (note that the dimension must be 2**nqubits for full ansazt and nqubits for Pauli ansatz). + s (float): A short flow duration for finding the numerical gradient. + delta (float): Step size for numerical gradient. + Returns: + grad (np.array): Gradient of the D operator. + """ + backend = _check_backend(backend) + nqubits = dbi_object.nqubits + grad = np.zeros(len(d_params)) + d = params_to_diagonal_operator( + d_params, nqubits, parameterization=parameterization, **kwargs + ) + for i in range(len(d_params)): + params_new = backend.cast(d_params, copy=True) + params_new[i] += delta + d_new = params_to_diagonal_operator( + params_new, nqubits, parameterization=parameterization, **kwargs + ) + # find the increment of a very small step + grad[i] = (dbi_object.loss(s, d_new) - dbi_object.loss(s, d)) / delta + return grad + + +def gradient_descent( + dbi_object: DoubleBracketIteration, + iterations: int, + d_params: list, + parameterization: ParameterizationTypes, + pauli_operator_dict: dict = None, + pauli_parameterization_order: int = 1, + normalize: bool = False, + lr_min: float = 1e-5, + lr_max: float = 1, + max_evals: int = 100, + space: callable = None, + optimizer: callable = hyperopt.tpe, + verbose: bool = False, + backend=None, +): + r"""Numerical gradient descent method for variating diagonal operator in each double bracket rotation. + + Args: + dbi_object (DoubleBracketIteration): the target double bracket object. + iterations (int): number of double bracket rotations. + d_params (list): the parameters for the initial diagonal operator. + parameterization (ParameterizationTypes): the parameterization method for diagonal operator. + Options include pauli and computational. + pauli_operator_dict (dictionary, optional): dictionary of "name": Pauli-operator for Pauli-based parameterization type. + Defaults to None. + pauli_parameterization_order (int, optional): the order of parameterization or locality in Pauli basis. Defaults to 1. + normalize (bool, optional): option to normalize the diagonal operator. Defaults to False. + lr_min (float, optional): the minimal gradient step. Defaults to 1e-5. + lr_max (float, optional): the maximal gradient step. Defaults to 1. + max_evals (int, optional): maximum number of evaluations for `lr` using `hyperopt`. Defaults to 100. + space (callable, optional): evalutation space for `hyperopt`. Defaults to None. + optimizer (callable, optional): optimizer option for `hyperopt`. Defaults to `hyperopt.tpe`. + verbose (bool, optional): option for printing `hyperopt` process. Defaults to False. + + Returns: + loss_hist (list): list of history losses of `dbi_object` throughout the double bracket rotations. + d_params_hist (list): list of history of `d` parameters after gradient descent. + s_hist (list): list of history of optimal `s` found. + Example: + from qibo import set_backend + from qibo.hamiltonians import Hamiltonian + from qibo.models.dbi.double_bracket import * + from qibo.models.dbi.utils import * + from qibo.models.dbi.utils_dbr_strategies import gradient_descent + from qibo.quantum_info import random_hermitian + + nqubits = 3 + NSTEPS = 5 + set_backend("numpy") + h0 = random_hermitian(2**nqubits) + dbi = DoubleBracketIteration( + Hamiltonian(nqubits, h0), + mode=DoubleBracketGeneratorType.single_commutator, + scheduling=DoubleBracketScheduling.hyperopt, + cost=DoubleBracketCostFunction.off_diagonal_norm, + ) + initial_off_diagonal_norm = dbi.off_diagonal_norm + pauli_operator_dict = generate_pauli_operator_dict( + nqubits, parameterization_order=1 + ) + pauli_operators = list(pauli_operator_dict.values()) + # let initial d be approximation of $\Delta(H) + d_coef_pauli = decompose_into_Pauli_basis( + dbi.diagonal_h_matrix, pauli_operators=pauli_operators + ) + d_pauli = sum([d_coef_pauli[i] * pauli_operators[i] for i in range(nqubits)]) + loss_hist_pauli, d_params_hist_pauli, s_hist_pauli = gradient_descent( + dbi, + NSTEPS, + d_coef_pauli, + ParameterizationTypes.pauli, + pauli_operator_dict=pauli_operator_dict, + ) + """ + backend = _check_backend(backend) + + nqubits = dbi_object.nqubits + # TODO: write tests where this condition applies + if ( + parameterization is ParameterizationTypes.pauli and pauli_operator_dict is None + ): # pragma: no cover + pauli_operator_dict = generate_pauli_operator_dict( + nqubits=nqubits, parameterization_order=pauli_parameterization_order + ) + d = params_to_diagonal_operator( + d_params, + nqubits, + parameterization=parameterization, + pauli_operator_dict=pauli_operator_dict, + normalize=normalize, + ) + loss_hist = [dbi_object.loss(0.0, d=d)] + d_params_hist = [d_params] + s_hist = [0] + # TODO: write tests where this condition applies + if ( + parameterization is ParameterizationTypes.pauli and pauli_operator_dict is None + ): # pragma: no cover + pauli_operator_dict = generate_pauli_operator_dict( + nqubits=nqubits, + parameterization_order=pauli_parameterization_order, + backend=backend, + ) + # first step + s = dbi_object.choose_step(d=d) + dbi_object(step=s, d=d) + for _ in range(iterations): + grad = gradient_numerical( + dbi_object, + d_params, + parameterization, + pauli_operator_dict=pauli_operator_dict, + pauli_parameterization_order=pauli_parameterization_order, + normalize=normalize, + backend=backend, + ) + + # set up hyperopt to find optimal lr + def func_loss_to_lr(lr): + d_params_eval = [d_params[j] - grad[j] * lr for j in range(len(grad))] + d_eval = params_to_diagonal_operator( + d_params_eval, + nqubits, + parameterization=parameterization, + pauli_operator_dict=pauli_operator_dict, + normalize=normalize, + ) + return dbi_object.loss(step=s, d=d_eval) + + if space is None: + space = hyperopt.hp.loguniform("lr", np.log(lr_min), np.log(lr_max)) + + best = hyperopt.fmin( + fn=func_loss_to_lr, + space=space, + algo=optimizer.suggest, + max_evals=max_evals, + verbose=verbose, + ) + lr = best["lr"] + + d_params = [d_params[j] - grad[j] * lr for j in range(len(grad))] + d = params_to_diagonal_operator( + d_params, + nqubits, + parameterization=parameterization, + pauli_operator_dict=pauli_operator_dict, + normalize=normalize, + ) + s = dbi_object.choose_step(d=d) + dbi_object(step=s, d=d) + + # record history + loss_hist.append(dbi_object.loss(0.0, d=d)) + d_params_hist.append(d_params) + s_hist.append(s) + return loss_hist, d_params_hist, s_hist diff --git a/src/qibo/models/dbi/utils_scheduling.py b/src/qibo/models/dbi/utils_scheduling.py new file mode 100644 index 0000000000..130cd88f30 --- /dev/null +++ b/src/qibo/models/dbi/utils_scheduling.py @@ -0,0 +1,212 @@ +import math +from functools import partial +from typing import Optional + +import hyperopt +import numpy as np + +error = 1e-3 + + +def grid_search_step( + dbi_object, + step_min: float = 1e-5, + step_max: float = 1, + num_evals: int = 100, + space: Optional[np.array] = None, + d: Optional[np.array] = None, +): + """ + Greedy optimization of the iteration step. + + Args: + step_min: lower bound of the search grid; + step_max: upper bound of the search grid; + mnum_evals: number of iterations between step_min and step_max; + d: diagonal operator for generating double-bracket iterations. + + Returns: + (float): optimized best iteration step (minimizing off-diagonal norm). + """ + if space is None: + space = np.linspace(step_min, step_max, num_evals) + + if d is None: + d = dbi_object.diagonal_h_matrix + + loss_list = [dbi_object.loss(step, d=d) for step in space] + + idx_max_loss = np.argmin(loss_list) + return space[idx_max_loss] + + +def hyperopt_step( + dbi_object, + step_min: float = 1e-5, + step_max: float = 1, + max_evals: int = 100, + space: callable = None, + optimizer: callable = None, + look_ahead: int = 1, + d: Optional[np.array] = None, +): + """ + Optimize iteration step using hyperopt. + + Args: + step_min: lower bound of the search grid; + step_max: upper bound of the search grid; + max_evals: maximum number of iterations done by the hyperoptimizer; + space: see hyperopt.hp possibilities; + optimizer: see hyperopt algorithms; + look_ahead: number of iteration steps to compute the loss function; + d: diagonal operator for generating double-bracket iterations. + + Returns: + (float): optimized best iteration step (minimizing loss function). + """ + if space is None: + space = hyperopt.hp.uniform + if optimizer is None: + optimizer = hyperopt.tpe + if d is None: + d = dbi_object.diagonal_h_matrix + + space = space("step", step_min, step_max) + + best = hyperopt.fmin( + fn=partial(dbi_object.loss, d=d, look_ahead=look_ahead), + space=space, + algo=optimizer.suggest, + max_evals=max_evals, + show_progressbar=False, + ) + return best["step"] + + +def polynomial_step( + dbi_object, + n: int = 2, + n_max: int = 5, + d: np.array = None, + coef: Optional[list] = None, + cost: Optional[str] = None, +): + r""" + Optimizes iteration step by solving the n_th order polynomial expansion of the loss function. + e.g. $n=2$: $2\Trace(\sigma(\Gamma_1 + s\Gamma_2 + s^2/2\Gamma_3)\sigma(\Gamma_0 + s\Gamma_1 + s^2/2\Gamma_2)) + Args: + n (int, optional): the order to which the loss function is expanded. Defaults to 4. + n_max (int, optional): maximum order allowed for recurring calls of `polynomial_step`. Defaults to 5. + d (np.array, optional): diagonal operator, default as $\delta(H)$. + backup_scheduling (`DoubleBracketScheduling`): the scheduling method to use in case no real positive roots are found. + """ + if cost is None: + cost = dbi_object.cost + + if d is None: + d = dbi_object.diagonal_h_matrix + + if n > n_max: + raise ValueError( + "No solution can be found with polynomial approximation. Increase `n_max` or use other scheduling methods." + ) + if coef is None: + coef = dbi_object.cost_expansion(d=d, n=n) + roots = np.roots(coef) + real_positive_roots = [ + np.real(root) for root in roots if np.imag(root) < 1e-3 and np.real(root) > 0 + ] + # solution exists, return minimum s + if len(real_positive_roots) > 0: + losses = [dbi_object.loss(step=root, d=d) for root in real_positive_roots] + return real_positive_roots[losses.index(min(losses))] + # solution does not exist, return None + else: + return None + + +def simulated_annealing_step( + dbi_object, + d: Optional[np.array] = None, + initial_s=None, + step_min=1e-5, + step_max=1, + s_jump_range=None, + s_jump_range_divident=5, + initial_temp=1, + cooling_rate=0.85, + min_temp=1e-5, + max_iter=200, +): + """ + Perform a single step of simulated annealing optimization. + + Parameters: + dbi_object: DBI object + The object representing the problem to be optimized. + d: Optional[np.array], optional + The diagonal matrix 'd' used in optimization. If None, it uses the diagonal + matrix 'diagonal_h_matrix' from dbi_object. + initial_s: float or None, optional + Initial value for 's', the step size. If None, it is initialized using + polynomial_step function with 'n=4'. If 'polynomial_step' returns None, + 'initial_s' is set to 'step_min'. + step_min: float, optional + Minimum value for the step size 's'. + step_max: float, optional + Maximum value for the step size 's'. + s_jump_range: float or None, optional + Range for the random jump in step size. If None, it's calculated based on + 'step_min', 'step_max', and 's_jump_range_divident'. + s_jump_range_divident: int, optional + Dividend to determine the range for random jump in step size. + initial_temp: float, optional + Initial temperature for simulated annealing. + cooling_rate: float, optional + Rate at which temperature decreases in simulated annealing. + min_temp: float, optional + Minimum temperature threshold for termination of simulated annealing. + max_iter: int, optional + Maximum number of iterations for simulated annealing. + + Returns: + float: + The optimized step size 's'. + """ + + if d is None: + d = dbi_object.diagonal_h_matrix + if initial_s is None: + initial_s = polynomial_step(dbi_object=dbi_object, d=d, n=4) + # TODO: implement test to catch this if statement + if initial_s is None: # pragma: no cover + initial_s = step_min + if s_jump_range is None: + s_jump_range = (step_max - step_min) / s_jump_range_divident + current_s = initial_s + current_loss = dbi_object.loss(d=d, step=current_s) + temp = initial_temp + + for _ in range(max_iter): + candidate_s = max( + step_min, + min( + current_s + np.random.uniform(-1 * s_jump_range, s_jump_range), step_max + ), + ) + candidate_loss = dbi_object.loss(d=d, step=candidate_s) + + # Calculate change in loss + delta_loss = candidate_loss - current_loss + + # Determine if the candidate solution is an improvement + if delta_loss < 0 or np.random.rand() < math.exp(-delta_loss / temp): + current_s = candidate_s + current_loss = candidate_loss + # Cool down + temp *= cooling_rate + if temp < min_temp or current_s > step_max or current_s < step_min: + break + + return current_s diff --git a/src/qibo/models/error_mitigation.py b/src/qibo/models/error_mitigation.py index 1b1252244b..606e822bc4 100644 --- a/src/qibo/models/error_mitigation.py +++ b/src/qibo/models/error_mitigation.py @@ -6,7 +6,7 @@ from scipy.optimize import curve_fit from qibo import gates -from qibo.backends import GlobalBackend, _check_backend +from qibo.backends import GlobalBackend, _check_backend, _check_backend_and_local_state from qibo.config import raise_error @@ -110,6 +110,7 @@ def ZNE( insertion_gate="CNOT", readout=None, qubit_map=None, + seed=None, backend=None, ): """Runs the Zero Noise Extrapolation method for error mitigation. @@ -136,7 +137,11 @@ def ZNE( * response_matrix: numpy.ndarray, used for applying a pre-computed response matrix for readout error mitigation. * ibu_iters: int, specifies the number of iterations for the iterative Bayesian unfolding method of readout error mitigation. If provided, the corresponding readout error mitigation method is used. Defaults to {}. - qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. Defaults to ``None``. + qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. + Defaults to ``None``. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be used in the execution. If ``None``, it uses :class:`qibo.backends.GlobalBackend`. Defaults to ``None``. @@ -148,7 +153,7 @@ def ZNE( 1. K. Temme, S. Bravyi et al, *Error mitigation for short-depth quantum circuits*. `arXiv:1612.02058 [quant-ph] `_. """ - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if readout is None: readout = {} @@ -165,6 +170,7 @@ def ZNE( nshots, readout, qubit_map, + seed=local_state, backend=backend, ) expected_values.append(val) @@ -178,6 +184,7 @@ def sample_training_circuit_cdr( circuit, replacement_gates: list = None, sigma: float = 0.5, + seed=None, backend=None, ): """Samples a training circuit for CDR by susbtituting some of the non-Clifford gates. @@ -190,6 +197,9 @@ def sample_training_circuit_cdr( form (``gates.XYZ``, ``kwargs``). For example, phase gates are used by default: ``list((RZ, {'theta':0}), (RZ, {'theta':pi/2}), (RZ, {'theta':pi}), (RZ, {'theta':3*pi/2}))``. sigma (float, optional): standard devation of the Gaussian distribution used for sampling. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be used in the execution. If ``None``, it uses :class:`qibo.backends.GlobalBackend`. Defaults to ``None``. @@ -197,7 +207,7 @@ def sample_training_circuit_cdr( Returns: :class:`qibo.models.Circuit`: The sampled circuit. """ - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if replacement_gates is None: replacement_gates = [(gates.RZ, {"theta": n * np.pi / 2}) for n in range(4)] @@ -221,7 +231,7 @@ def sample_training_circuit_cdr( distance.append( np.linalg.norm( gate.matrix(backend) - - [rep_gate.matrix(backend) for rep_gate in rep_gates], + - backend.cast([rep_gate.matrix(backend) for rep_gate in rep_gates]), ord="fro", axis=(1, 2), ) @@ -229,20 +239,23 @@ def sample_training_circuit_cdr( distance = np.vstack(distance) prob = np.exp(-(distance**2) / sigma**2) + prob = backend.cast(prob, dtype=prob.dtype) - index = np.random.choice( + index = local_state.choice( range(len(gates_to_replace)), size=min(int(len(gates_to_replace) / 2), 50), replace=False, - p=prob.sum(-1) / prob.sum(), + p=backend.to_numpy(backend.np.sum(prob, -1) / backend.np.sum(prob)), ) gates_to_replace = np.array([gates_to_replace[i] for i in index]) prob = [prob[i] for i in index] + prob = backend.cast(prob, dtype=prob[0].dtype) + prob = backend.to_numpy(prob) replacement = np.array([replacement[i] for i in index]) replacement = [ - replacement[i][np.random.choice(range(len(p)), size=1, p=p / p.sum())[0]] + replacement[i][local_state.choice(range(len(p)), size=1, p=p / np.sum(p))[0]] for i, p in enumerate(prob) ] replacement = {i[0]: g for i, g in zip(gates_to_replace, replacement)} @@ -264,6 +277,7 @@ def CDR( full_output: bool = False, readout=None, qubit_map=None, + seed=None, backend=None, ): """Runs the Clifford Data Regression error mitigation method. @@ -287,7 +301,11 @@ def CDR( * response_matrix: numpy.ndarray, used for applying a pre-computed response matrix for readout error mitigation. * ibu_iters: int, specifies the number of iterations for the iterative Bayesian unfolding method of readout error mitigation. If provided, the corresponding readout error mitigation method is used. Defaults to {}. - qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. Defaults to ``None``. + qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. + Defaults to ``None``. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be used in the execution. If ``None``, it uses :class:`qibo.backends.GlobalBackend`. Defaults to ``None``. @@ -302,13 +320,14 @@ def CDR( 1. P. Czarnik, A. Arrasmith et al, *Error mitigation with Clifford quantum-circuit data*. `arXiv:2005.10189 [quant-ph] `_. """ - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if readout is None: readout = {} training_circuits = [ - sample_training_circuit_cdr(circuit) for _ in range(n_training_samples) + sample_training_circuit_cdr(circuit, seed=local_state, backend=backend) + for _ in range(n_training_samples) ] train_val = {"noise-free": [], "noisy": []} @@ -317,18 +336,32 @@ def CDR( val = result.expectation_from_samples(observable) train_val["noise-free"].append(val) val = get_expectation_val_with_readout_mitigation( - circ, observable, noise_model, nshots, readout, qubit_map, backend=backend + circ, + observable, + noise_model, + nshots, + readout, + qubit_map, + seed=local_state, + backend=backend, ) train_val["noisy"].append(val) optimal_params = curve_fit(model, train_val["noisy"], train_val["noise-free"])[0] val = get_expectation_val_with_readout_mitigation( - circuit, observable, noise_model, nshots, readout, qubit_map, backend=backend + circuit, + observable, + noise_model, + nshots, + readout, + qubit_map, + seed=local_state, + backend=backend, ) mit_val = model(val, *optimal_params) - if full_output is True: + if full_output: return mit_val, val, optimal_params, train_val return mit_val @@ -346,6 +379,7 @@ def vnCDR( full_output: bool = False, readout=None, qubit_map=None, + seed=None, backend=None, ): """Runs the variable-noise Clifford Data Regression error mitigation method. @@ -374,6 +408,9 @@ def vnCDR( * ibu_iters: int, specifies the number of iterations for the iterative Bayesian unfolding method of readout error mitigation. If provided, the corresponding readout error mitigation method is used. Defaults to {}. qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. Defaults to ``None``. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be used in the execution. If ``None``, it uses :class:`qibo.backends.GlobalBackend`. Defaults to ``None``. @@ -389,13 +426,14 @@ def vnCDR( 1. A. Lowe, MH. Gordon et al, *Unified approach to data-driven quantum error mitigation*. `arXiv:2011.01157 [quant-ph] `_. """ - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if readout is None: readout = {} training_circuits = [ - sample_training_circuit_cdr(circuit) for _ in range(n_training_samples) + sample_training_circuit_cdr(circuit, seed=local_state, backend=backend) + for _ in range(n_training_samples) ] train_val = {"noise-free": [], "noisy": []} @@ -412,13 +450,14 @@ def vnCDR( nshots, readout, qubit_map, + seed=local_state, backend=backend, ) train_val["noisy"].append(val) noisy_array = np.array(train_val["noisy"]).reshape(-1, len(noise_levels)) - params = np.random.rand(len(noise_levels)) + params = local_state.random(len(noise_levels)) optimal_params = curve_fit(model, noisy_array.T, train_val["noise-free"], p0=params) val = [] @@ -431,13 +470,14 @@ def vnCDR( nshots, readout, qubit_map, + seed=local_state, backend=backend, ) val.append(expval) mit_val = model(np.array(val).reshape(-1, 1), *optimal_params[0])[0] - if full_output is True: + if full_output: return mit_val, val, optimal_params, train_val return mit_val @@ -567,9 +607,14 @@ def apply_randomized_readout_mitigation( nshots: int = 10000, ncircuits: int = 10, qubit_map=None, + seed=None, backend=None, ): - """Readout mitigation method that transforms the bias in an expectation value into a measurable multiplicative factor. This factor can be eliminated at the expense of increased sampling complexity for the observable. + """Readout mitigation method that transforms the bias in an expectation value into a + measurable multiplicative factor. + + This factor can be eliminated at the expense of increased sampling complexity + for the observable. Args: circuit (:class:`qibo.models.Circuit`): input circuit. @@ -578,7 +623,11 @@ def apply_randomized_readout_mitigation( nshots (int, optional): number of shots. Defaults to :math:`10000`. ncircuits (int, optional): number of randomized circuits. Each of them uses ``int(nshots / ncircuits)`` shots. Defaults to 10. - qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. Defaults to ``None``. + qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. + Defaults to ``None``. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be used in the execution. If ``None``, it uses :class:`qibo.backends.GlobalBackend`. Defaults to ``None``. @@ -589,7 +638,8 @@ def apply_randomized_readout_mitigation( Reference: - 1. Ewout van den Berg, Zlatko K. Minev et al, *Model-free readout-error mitigation for quantum expectation values*. + 1. Ewout van den Berg, Zlatko K. Minev et al, + *Model-free readout-error mitigation for quantum expectation values*. `arXiv:2012.09738 [quant-ph] `_. """ from qibo import Circuit # pylint: disable=import-outside-toplevel @@ -597,7 +647,7 @@ def apply_randomized_readout_mitigation( random_pauli, ) - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) meas_qubits = circuit.measurements[0].qubits nshots_r = int(nshots / ncircuits) @@ -607,7 +657,9 @@ def apply_randomized_readout_mitigation( circuit_c.queue.pop() cal_circuit = Circuit(circuit.nqubits, density_matrix=True) - x_gate = random_pauli(circuit.nqubits, 1, subset=["I", "X"]).queue + x_gate = random_pauli( + circuit.nqubits, 1, subset=["I", "X"], seed=local_state + ).queue error_map = {} for j, gate in enumerate(x_gate): @@ -646,6 +698,7 @@ def get_expectation_val_with_readout_mitigation( nshots: int = 10000, readout=None, qubit_map=None, + seed=None, backend=None, ): """ @@ -662,21 +715,30 @@ def get_expectation_val_with_readout_mitigation( * response_matrix: numpy.ndarray, used for applying a pre-computed response matrix for readout error mitigation. * ibu_iters: int, specifies the number of iterations for the iterative Bayesian unfolding method of readout error mitigation. If provided, the corresponding readout error mitigation method is used. Defaults to {}. - qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. Defaults to ``None``. + qubit_map (list, optional): the qubit map. If None, a list of range of circuit's qubits is used. + Defaults to ``None``. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (qibo.backends.abstract.Backend, optional): the backend to be used in the execution. If None, it uses the global backend. Defaults to ``None``. Returns: float: the mitigated expectation value of the observable. """ - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if readout is None: # pragma: no cover readout = {} if "ncircuits" in readout: circuit_result, circuit_result_cal = apply_randomized_readout_mitigation( - circuit, noise_model, nshots, readout["ncircuits"], backend + circuit, + noise_model, + nshots, + readout["ncircuits"], + seed=local_state, + backend=backend, ) else: circuit_result = _execute_circuit( @@ -699,12 +761,16 @@ def get_expectation_val_with_readout_mitigation( def sample_clifford_training_circuit( circuit, + seed=None, backend=None, ): """Samples a training circuit for CDR by susbtituting all the non-Clifford gates. Args: circuit (:class:`qibo.models.Circuit`): circuit to sample from. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be used in the execution. If ``None``, it uses :class:`qibo.backends.GlobalBackend`. Defaults to ``None``. @@ -716,7 +782,7 @@ def sample_clifford_training_circuit( random_clifford, ) - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) non_clifford_gates_indices = [ i @@ -733,7 +799,9 @@ def sample_clifford_training_circuit( if isinstance(gate, gates.M): for q in gate.qubits: gate_rand = gates.Unitary( - random_clifford(1, backend=backend, return_circuit=False), + random_clifford( + 1, return_circuit=False, seed=local_state, backend=backend + ), q, ) gate_rand.clifford = True @@ -743,7 +811,10 @@ def sample_clifford_training_circuit( if i in non_clifford_gates_indices: gate = gates.Unitary( random_clifford( - len(gate.qubits), backend=backend, return_circuit=False + len(gate.qubits), + return_circuit=False, + seed=local_state, + backend=backend, ), *gate.qubits, ) @@ -753,13 +824,17 @@ def sample_clifford_training_circuit( return sampled_circuit -def error_sensitive_circuit(circuit, observable, backend=None): +def error_sensitive_circuit(circuit, observable, seed=None, backend=None): """ Generates a Clifford circuit that preserves the same circuit frame as the input circuit, and stabilizes the specified Pauli observable. Args: circuit (:class:`qibo.models.Circuit`): input circuit. - observable (:class:`qibo.hamiltonians.Hamiltonian/:class:`qibo.hamiltonians.SymbolicHamiltonian`): Pauli observable to be measured. + observable (:class:`qibo.hamiltonians.Hamiltonian` or :class:`qibo.hamiltonians.SymbolicHamiltonian`): + Pauli observable to be measured. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (:class:`qibo.backends.abstract.Backend`, optional): backend to be used in the execution. if ``None``, it uses :class:`qibo.backends.GlobalBackend`. Defaults to ``None``. @@ -773,15 +848,18 @@ def error_sensitive_circuit(circuit, observable, backend=None): 1. Dayue Qin, Yanzhu Chen et al, *Error statistics and scalability of quantum error mitigation formulas*. `arXiv:2112.06255 [quant-ph] `_. """ + from qibo import matrices # pylint: disable=import-outside-toplevel from qibo.quantum_info import ( # pylint: disable=import-outside-toplevel comp_basis_to_pauli, random_clifford, vectorization, ) - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) - sampled_circuit = sample_clifford_training_circuit(circuit, backend=backend) + sampled_circuit = sample_clifford_training_circuit( + circuit, seed=local_state, backend=backend + ) unitary_matrix = sampled_circuit.unitary(backend=backend) num_qubits = sampled_circuit.nqubits @@ -803,10 +881,10 @@ def error_sensitive_circuit(circuit, observable, backend=None): observable_pauli = list(product(["I", "X", "Y", "Z"], repeat=num_qubits))[index] pauli_gates = { - "I": backend.cast(gates.I(0).matrix(backend=backend)), - "X": backend.cast(gates.X(0).matrix(backend=backend)), - "Y": backend.cast(gates.Y(0).matrix(backend=backend)), - "Z": backend.cast(gates.Z(0).matrix(backend=backend)), + "I": backend.cast(matrices.I, dtype=matrices.I.dtype), + "X": backend.cast(matrices.X, dtype=matrices.X.dtype), + "Y": backend.cast(matrices.Y, dtype=matrices.Y.dtype), + "Z": backend.cast(matrices.Z, dtype=matrices.Z.dtype), } adjustment_gates = [] @@ -816,7 +894,9 @@ def error_sensitive_circuit(circuit, observable, backend=None): while backend.np.any( backend.np.abs(observable_i - pauli_gates["Z"]) > 1e-5 ) and backend.np.any(abs(observable_i - pauli_gates["I"]) > 1e-5): - random_init = random_clifford(1, backend=backend, return_circuit=False) + random_init = random_clifford( + 1, return_circuit=False, seed=local_state, backend=backend + ) observable_i = ( backend.np.conj(backend.np.transpose(random_init, (1, 0))) @ pauli_gates[observable_pauli[i]] @@ -846,6 +926,7 @@ def ICS( nshots=int(1e4), n_training_samples=10, full_output=False, + seed=None, backend=None, ): """ @@ -860,12 +941,16 @@ def ICS( * response_matrix: numpy.ndarray, used for applying a pre-computed response matrix for readout error mitigation. * ibu_iters: int, specifies the number of iterations for the iterative Bayesian unfolding method of readout error mitigation. If provided, the corresponding readout error mitigation method is used. Defaults to {}. - qubit_map (list, optional): the qubit map. If ``None``, a list of range of circuit's qubits is used. Defaults to ``None``. + qubit_map (list, optional): the qubit map. If ``None``, a list of range of circuit's qubits is used. + Defaults to ``None``. noise_model (qibo.models.noise.Noise, optional): the noise model to be applied. Defaults to ``None``. nshots (int, optional): the number of shots for the circuit execution. Defaults to :math:`10000`. n_training_samples (int, optional): the number of training samples. Defaults to 10. full_output (bool, optional): if ``True``, this function returns additional information: ``val``, ``optimal_params``, ``train_val``. Defaults to ``False``. + seed (int or :class:`numpy.random.Generator`, optional): Either a generator of random + numbers or a fixed seed to initialize a generator. If ``None``, initializes + a generator with a random seed. Default: ``None``. backend (qibo.backends.abstract.Backend, optional): the backend to be used in the execution. If None, it uses the global backend. Defaults to ``None``. @@ -881,7 +966,7 @@ def ICS( 1. Dayue Qin, Yanzhu Chen et al, *Error statistics and scalability of quantum error mitigation formulas*. `arXiv:2112.06255 [quant-ph] `_. """ - backend = _check_backend(backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if readout is None: readout = {} @@ -890,7 +975,9 @@ def ICS( qubit_map = list(range(circuit.nqubits)) training_circuits = [ - error_sensitive_circuit(circuit, observable, backend=backend)[0] + error_sensitive_circuit(circuit, observable, seed=local_state, backend=backend)[ + 0 + ] for _ in range(n_training_samples) ] @@ -908,6 +995,7 @@ def ICS( nshots, readout, qubit_map, + seed=local_state, backend=backend, ) @@ -919,7 +1007,14 @@ def ICS( dep_param_std = np.std(lambda_list) noisy_expectation = get_expectation_val_with_readout_mitigation( - circuit, observable, noise_model, nshots, readout, qubit_map, backend=backend + circuit, + observable, + noise_model, + nshots, + readout, + qubit_map, + seed=local_state, + backend=backend, ) one_dep_squared = (1 - dep_param) ** 2 dep_std_squared = dep_param_std**2 diff --git a/src/qibo/models/variational.py b/src/qibo/models/variational.py index 8ec93b2cbb..aeeaa6352c 100644 --- a/src/qibo/models/variational.py +++ b/src/qibo/models/variational.py @@ -96,7 +96,6 @@ def minimize( loss = lambda p, c, h: dtype(loss_func(p, c, h)) elif method != "sgd": loss = lambda p, c, h: self.hamiltonian.backend.to_numpy(loss_func(p, c, h)) - result, parameters, extra = self.optimizers.optimize( loss, initial_state, diff --git a/src/qibo/optimizers.py b/src/qibo/optimizers.py index 0b5c46c778..6645326d95 100644 --- a/src/qibo/optimizers.py +++ b/src/qibo/optimizers.py @@ -84,13 +84,13 @@ def myloss(parameters, circuit): RuntimeError, "The keyword 'bounds' cannot be used with the cma optimizer. Please use 'options' instead as defined by the cma documentation: ex. options['bounds'] = [0.0, 1.0].", ) - return cmaes(loss, initial_parameters, args, options) + return cmaes(loss, initial_parameters, args, callback, options) elif method == "sgd": from qibo.backends import _check_backend backend = _check_backend(backend) - return sgd(loss, initial_parameters, args, options, compile, backend) + return sgd(loss, initial_parameters, args, callback, options, compile, backend) else: from qibo.backends import _check_backend @@ -114,7 +114,7 @@ def myloss(parameters, circuit): ) -def cmaes(loss, initial_parameters, args=(), options=None): +def cmaes(loss, initial_parameters, args=(), callback=None, options=None): """Genetic optimizer based on `pycma `_. Args: @@ -123,14 +123,30 @@ def cmaes(loss, initial_parameters, args=(), options=None): initial_parameters (np.ndarray): Initial guess for the variational parameters. args (tuple): optional arguments for the loss function. + callback (list[callable]): List of callable called after each optimization + iteration. According to cma-es implementation take ``CMAEvolutionStrategy`` + instance as argument. + See: https://cma-es.github.io/apidocs-pycma/cma.evolution_strategy.CMAEvolutionStrategy.html. options (dict): Dictionary with options accepted by the ``cma`` optimizer. The user can use ``import cma; cma.CMAOptions()`` to view the available options. """ import cma - r = cma.fmin2(loss, initial_parameters, 1.7, options=options, args=args) - return r[1].result.fbest, r[1].result.xbest, r + es = cma.CMAEvolutionStrategy(initial_parameters, sigma0=1.7, inopts=options) + + if callback is not None: + while not es.stop(): + solutions = es.ask() + objective_values = [loss(x, *args) for x in solutions] + for solution in solutions: + callback(solution) + es.tell(solutions, objective_values) + es.logger.add() + else: + es.optimize(loss, args=args) + + return es.result.fbest, es.result.xbest, es.result def newtonian( @@ -213,7 +229,15 @@ def newtonian( return m.fun, m.x, m -def sgd(loss, initial_parameters, args=(), options=None, compile=False, backend=None): +def sgd( + loss, + initial_parameters, + args=(), + callback=None, + options=None, + compile=False, + backend=None, +): """Stochastic Gradient Descent (SGD) optimizer using Tensorflow backpropagation. See `tf.keras.Optimizers `_ @@ -225,6 +249,7 @@ def sgd(loss, initial_parameters, args=(), options=None, compile=False, backend= initial_parameters (np.ndarray): Initial guess for the variational parameters. args (tuple): optional arguments for the loss function. + callback (callable): Called after each iteration. options (dict): Dictionary with options for the SGD optimizer. Supports the following keys: @@ -234,6 +259,7 @@ def sgd(loss, initial_parameters, args=(), options=None, compile=False, backend= - ``'nmessage'`` (int, default: ``1e3``): Every how many epochs to print a message of the loss function. """ + if not backend.name == "tensorflow": raise_error(RuntimeError, "SGD optimizer requires Tensorflow backend.") @@ -265,6 +291,8 @@ def opt_step(): for e in range(sgd_options["nepochs"]): l = opt_step() + if callback is not None: + callback(vparams) if e % sgd_options["nmessage"] == 1: log.info("ite %d : loss %f", e, l.numpy()) diff --git a/src/qibo/quantum_info/entropies.py b/src/qibo/quantum_info/entropies.py index 3d4e7ac027..d6499e15dc 100644 --- a/src/qibo/quantum_info/entropies.py +++ b/src/qibo/quantum_info/entropies.py @@ -461,7 +461,7 @@ def von_neumann_entropy( if purity(state) == 1.0: if return_spectrum: - return 0.0, backend.cast([1.0], dtype=float) + return 0.0, backend.cast([0.0], dtype=float) return 0.0 diff --git a/src/qibo/quantum_info/random_ensembles.py b/src/qibo/quantum_info/random_ensembles.py index 26e6932f1b..e6d9faf49b 100644 --- a/src/qibo/quantum_info/random_ensembles.py +++ b/src/qibo/quantum_info/random_ensembles.py @@ -8,8 +8,8 @@ import numpy as np from scipy.stats import rv_continuous -from qibo import Circuit, gates -from qibo.backends import NumpyBackend, _check_backend +from qibo import Circuit, gates, matrices +from qibo.backends import NumpyBackend, _check_backend_and_local_state from qibo.config import MAX_ITERATIONS, PRECISION_TOL, raise_error from qibo.quantum_info.basis import comp_basis_to_pauli from qibo.quantum_info.superoperator_transformations import ( @@ -67,7 +67,7 @@ def uniform_sampling_U3(ngates: int, seed=None, backend=None): elif ngates <= 0: raise_error(ValueError, f"ngates must be non-negative, but it is {ngates}.") - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) sampler = _probability_distribution_sin(a=0, b=np.pi, seed=local_state) phases = local_state.random((ngates, 3)) @@ -133,7 +133,7 @@ def random_gaussian_matrix( if stddev is not None and stddev <= 0.0: raise_error(ValueError, "stddev must be a positive float.") - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) dims = (dims, rank) @@ -179,7 +179,7 @@ def random_hermitian( if not isinstance(semidefinite, bool) or not isinstance(normalize, bool): raise_error(TypeError, "semidefinite and normalize must be type bool.") - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) matrix = random_gaussian_matrix(dims, dims, seed=local_state, backend=backend) @@ -226,7 +226,7 @@ def random_unitary(dims: int, measure: Optional[str] = None, seed=None, backend= if measure != "haar": raise_error(ValueError, f"measure {measure} not implemented.") - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if measure == "haar": unitary = random_gaussian_matrix(dims, dims, seed=local_state, backend=backend) @@ -342,7 +342,7 @@ def random_quantum_channel( NotImplementedError, f"order {order} not implemented for measure {measure}." ) - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if measure == "bcsz": super_op = _super_op_from_bcsz_measure( @@ -434,7 +434,7 @@ def random_statevector(dims: int, seed=None, backend=None): TypeError, "seed must be either type int or numpy.random.Generator." ) - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) state = local_state.standard_normal(dims).astype(complex) state += 1.0j * local_state.standard_normal(dims) @@ -539,7 +539,7 @@ def random_density_matrix( elif normalize is True and basis is None: raise_error(ValueError, "normalize cannot be True when basis=None.") - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if metric == "hilbert-schmidt": rank = None @@ -628,7 +628,7 @@ def random_clifford( f"return_circuit must be type bool, but it is type {type(return_circuit)}.", ) - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) hadamards, permutations = _sample_from_quantum_mallows_distribution( nqubits, local_state=local_state @@ -809,9 +809,13 @@ def random_pauli( "subset argument must be a subset of strings in the set ['I', 'X', 'Y', 'Z'].", ) - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) - complete_set = {"I": gates.I, "X": gates.X, "Y": gates.Y, "Z": gates.Z} + complete_set = ( + {"I": gates.I, "X": gates.X, "Y": gates.Y, "Z": gates.Z} + if return_circuit + else {"I": matrices.I, "X": matrices.X, "Y": matrices.Y, "Z": matrices.Z} + ) if subset is None: subset = complete_set @@ -840,13 +844,9 @@ def random_pauli( if subset[column_item] != gates.I: gate_grid.add(subset[column_item](qubit)) else: - gate_grid = np.array( - [ - [subset[column_item](qubit).matrix(backend) for column_item in row] - for qubit, row in zip(qubits, indexes) - ] + gate_grid = backend.cast( + [[subset[column_item] for column_item in row] for row in indexes] ) - gate_grid = backend.cast(gate_grid, dtype=gate_grid.dtype) return gate_grid @@ -912,7 +912,7 @@ def random_pauli_hamiltonian( "when normalize=True, gap is = 1, thus max_eigenvalue must be > 1.", ) - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) d = 2**nqubits @@ -1016,7 +1016,7 @@ def random_stochastic_matrix( if max_iterations <= 0.0: raise_error(ValueError, "max_iterations must be a positive int.") - backend, local_state = _set_backend_and_local_state(seed, backend) + backend, local_state = _check_backend_and_local_state(seed, backend) if precision_tol is None: precision_tol = PRECISION_TOL @@ -1104,17 +1104,17 @@ def _sample_from_quantum_mallows_distribution(nqubits: int, local_state): @cache def _create_S(q): - return gates.S(q) + return gates.S(int(q)) @cache def _create_CZ(cq, tq): - return gates.CZ(cq, tq) + return gates.CZ(int(cq), int(tq)) @cache def _create_CNOT(cq, tq): - return gates.CNOT(cq, tq) + return gates.CNOT(int(cq), int(tq)) def _operator_from_hadamard_free_group( @@ -1219,29 +1219,3 @@ def _super_op_from_bcsz_measure(dims: int, rank: int, order: str, seed, backend) super_op = operator @ super_op @ operator return super_op - - -def _set_backend_and_local_state(seed, backend): - if ( - seed is not None - and not isinstance(seed, int) - and not isinstance(seed, np.random.Generator) - ): - raise_error( - TypeError, "seed must be either type int or numpy.random.Generator." - ) - - backend = _check_backend(backend) - - if seed is None or isinstance(seed, int): - if backend.__class__.__name__ in [ - "CupyBackend", - "CuQuantumBackend", - ]: # pragma: no cover - local_state = backend.np.random.default_rng(seed) - else: - local_state = np.random.default_rng(seed) - else: - local_state = seed - - return backend, local_state diff --git a/src/qibo/transpiler/decompositions.py b/src/qibo/transpiler/decompositions.py index f559f0088a..bae39e38bd 100644 --- a/src/qibo/transpiler/decompositions.py +++ b/src/qibo/transpiler/decompositions.py @@ -465,3 +465,24 @@ def _u3_to_gpi2(t, p, l): standard_decompositions.add( gates.ECR, [gates.S(0), gates.SX(1), gates.CNOT(0, 1), gates.X(0)] ) +standard_decompositions.add(gates.CCZ, [gates.H(2), gates.TOFFOLI(0, 1, 2), gates.H(2)]) +standard_decompositions.add( + gates.TOFFOLI, + [ + gates.H(2), + gates.CNOT(1, 2), + gates.TDG(2), + gates.CNOT(0, 2), + gates.T(2), + gates.CNOT(1, 2), + gates.T(1), + gates.TDG(2), + gates.CNOT(0, 2), + gates.CNOT(0, 1), + gates.T(2), + gates.T(0), + gates.TDG(1), + gates.H(2), + gates.CNOT(0, 1), + ], +) diff --git a/src/qibo/transpiler/pipeline.py b/src/qibo/transpiler/pipeline.py index 7d9b68e130..04c1072d0a 100644 --- a/src/qibo/transpiler/pipeline.py +++ b/src/qibo/transpiler/pipeline.py @@ -225,7 +225,7 @@ def __call__(self, circuit): physical (keys) to logical (values) qubit. If `int_qubit_name` is `True` each key `i` correspond to the `i-th` qubit in the graph. """ - final_layout = self.initial_layout + self.initial_layout = None for transpiler_pass in self.passes: if isinstance(transpiler_pass, Optimizer): transpiler_pass.connectivity = self.connectivity @@ -234,6 +234,9 @@ def __call__(self, circuit): transpiler_pass.connectivity = self.connectivity if self.initial_layout == None: self.initial_layout = transpiler_pass(circuit) + final_layout = ( + self.initial_layout + ) # This way the final layout will be the same as the initial layout if no router is used else: raise_error( TranspilerPipelineError, diff --git a/tests/test_backends.py b/tests/test_backends.py index 61ed409f49..876e931b2f 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -1,7 +1,10 @@ +import platform + import numpy as np import pytest -from qibo import gates +from qibo import construct_backend, gates, list_available_backends, set_backend +from qibo.backends import MetaBackend ####################### Test `matrix` ####################### GATES = [ @@ -122,3 +125,33 @@ def test_plus_density_matrix(backend): matrix = backend.plus_density_matrix(4) target_matrix = np.ones((16, 16)) / 16 backend.assert_allclose(matrix, target_matrix) + + +def test_set_backend_error(): + with pytest.raises(ValueError): + set_backend("non-existing-backend") + + +def test_metabackend_load_error(): + with pytest.raises(ValueError): + MetaBackend.load("non-existing-backend") + + +def test_construct_backend(backend): + assert isinstance( + construct_backend(backend.name, platform=backend.platform), backend.__class__ + ) + + +def test_list_available_backends(): + tensorflow = False if platform.system() == "Windows" else True + available_backends = { + "numpy": True, + "tensorflow": tensorflow, + "pytorch": True, + "qibojit": {"numba": True, "cupy": False, "cuquantum": False}, + "qibolab": False, + "qibo-cloud-backends": False, + "qibotn": {"cutensornet": False, "qutensornet": True}, + } + assert available_backends == list_available_backends() diff --git a/tests/test_global_backend.py b/tests/test_backends_global.py similarity index 100% rename from tests/test_global_backend.py rename to tests/test_backends_global.py diff --git a/tests/test_callbacks.py b/tests/test_callbacks.py index 5ff73f66a5..bf2ac7d2d0 100644 --- a/tests/test_callbacks.py +++ b/tests/test_callbacks.py @@ -97,7 +97,7 @@ def test_entropy_in_circuit(backend, density_matrix, base): values = [backend.to_numpy(x) for x in entropy] backend.assert_allclose(values, target, atol=PRECISION_TOL) - target_spectrum = [1.0] + list([0, 0, np.log(2), np.log(2)] / np.log(base)) + target_spectrum = [0.0] + list([0, 0, np.log(2), np.log(2)] / np.log(base)) entropy_spectrum = np.ravel(np.concatenate(entropy.spectrum)).tolist() backend.assert_allclose(entropy_spectrum, target_spectrum, atol=PRECISION_TOL) diff --git a/tests/test_cirq.py b/tests/test_cirq.py index 636581656d..8ff8498d7a 100644 --- a/tests/test_cirq.py +++ b/tests/test_cirq.py @@ -4,8 +4,9 @@ import numpy as np import pytest -from qibo import gates, models +from qibo import Circuit, gates, matrices from qibo.backends import NumpyBackend +from qibo.models import QFT from qibo.quantum_info import random_statevector, random_unitary numpy_backend = NumpyBackend() @@ -54,7 +55,7 @@ def assert_gates_equivalent( if ndevices is not None: accelerators = {"/GPU:0": ndevices} - c = models.Circuit(nqubits, accelerators) + c = Circuit(nqubits, accelerators) c.add(qibo_gate) assert c.depth == target_depth if accelerators and not backend.supports_multigpu: @@ -307,7 +308,7 @@ def test_unitary_matrix_gate_controlled_by(backend, nqubits, ntargets, ndevices) @pytest.mark.parametrize("nqubits", [5, 6, 7, 11, 12]) def test_qft(backend, accelerators, nqubits): - c = models.QFT(nqubits, accelerators=accelerators) + c = QFT(nqubits, accelerators=accelerators) initial_state = random_statevector(2**nqubits, backend=numpy_backend) final_state = backend.execute_circuit(c, np.copy(initial_state)).state() final_state = backend.cast(final_state, dtype=final_state.dtype) diff --git a/tests/test_gates_gates.py b/tests/test_gates_gates.py index d407e72e9e..2b2ae20973 100644 --- a/tests/test_gates_gates.py +++ b/tests/test_gates_gates.py @@ -3,9 +3,10 @@ import numpy as np import pytest -from qibo import gates +from qibo import Circuit, gates, matrices from qibo.parameter import Parameter from qibo.quantum_info import random_hermitian, random_statevector, random_unitary +from qibo.transpiler.decompositions import standard_decompositions def apply_gates(backend, gatelist, nqubits=None, initial_state=None): @@ -212,12 +213,12 @@ def test_align(backend): with pytest.raises(ValueError): gates.Align(0, delay=-1) - nqubits = 2 + nqubits = 1 - gate = gates.Align(0, 1) - gate_list = [gates.H(0), gates.H(1), gate] + gate = gates.Align(0, 0) + gate_list = [gates.H(0), gate] - final_state = apply_gates(backend, gate_list, nqubits=2) + final_state = apply_gates(backend, gate_list, nqubits=nqubits) target_state = backend.plus_state(nqubits) backend.assert_allclose(final_state, target_state) @@ -229,8 +230,8 @@ def test_align(backend): with pytest.raises(NotImplementedError): gate.qasm_label - assert not gates.Align(0, 1).clifford - assert not gates.Align(0, 1).unitary + assert not gates.Align(0, delay=0).clifford + assert not gates.Align(0, delay=0).unitary # :class:`qibo.core.cgates.M` is tested seperately in `test_measurement_gate.py` @@ -1205,6 +1206,53 @@ def test_toffoli(backend, applyx): assert not gates.TOFFOLI(0, 1, 2).clifford assert gates.TOFFOLI(0, 1, 2).unitary + # test decomposition + decomposition = Circuit(3) + decomposition.add(standard_decompositions(gates.TOFFOLI(0, 1, 2))) + decomposition = decomposition.unitary(backend) + + backend.assert_allclose(decomposition, backend.cast(matrices.TOFFOLI), atol=1e-10) + + +def test_ccz(backend): + nqubits = 3 + initial_state = random_statevector(2**nqubits, backend=backend) + final_state = apply_gates( + backend, + [gates.CCZ(0, 1, 2)], + nqubits=nqubits, + initial_state=initial_state, + ) + + matrix = np.array( + [ + [1, 0, 0, 0, 0, 0, 0, 0], + [0, 1, 0, 0, 0, 0, 0, 0], + [0, 0, 1, 0, 0, 0, 0, 0], + [0, 0, 0, 1, 0, 0, 0, 0], + [0, 0, 0, 0, 1, 0, 0, 0], + [0, 0, 0, 0, 0, 1, 0, 0], + [0, 0, 0, 0, 0, 0, 1, 0], + [0, 0, 0, 0, 0, 0, 0, -1], + ], + dtype=np.complex128, + ) + matrix = backend.cast(matrix, dtype=matrix.dtype) + + target_state = matrix @ initial_state + backend.assert_allclose(final_state, target_state) + + assert gates.CCZ(0, 1, 2).qasm_label == "ccz" + assert not gates.CCZ(0, 1, 2).clifford + assert gates.CCZ(0, 1, 2).unitary + + # test decomposition + decomposition = Circuit(3) + decomposition.add(gates.CCZ(0, 1, 2).decompose()) + decomposition = decomposition.unitary(backend) + + backend.assert_allclose(decomposition, backend.cast(matrices.CCZ), atol=1e-10) + def test_deutsch(backend): theta = 0.1234 diff --git a/tests/test_measurements_collapse.py b/tests/test_measurements_collapse.py index 2ff1c78428..12eb051828 100644 --- a/tests/test_measurements_collapse.py +++ b/tests/test_measurements_collapse.py @@ -18,7 +18,9 @@ def test_measurement_collapse(backend, nqubits, targets): c.add(gates.H(q)) r = c.add(gates.M(*targets, collapse=True)) c.add(gates.M(*targets)) - outcome = backend.execute_circuit(c, np.copy(initial_state), nshots=1) + outcome = backend.execute_circuit( + c, backend.cast(initial_state, copy=True), nshots=1 + ) samples = r.samples()[0] backend.assert_allclose(samples, outcome.samples()[0]) @@ -128,7 +130,7 @@ def test_measurement_result_parameters_repeated_execution(backend, use_loop): c, initial_state=np.copy(initial_state), nshots=1 ) final_states.append(final_state.state()) - final_states = np.asarray(final_states).mean(0) + final_states = backend.np.mean(backend.cast(final_states), 0) else: final_states = backend.execute_circuit( c, initial_state=np.copy(initial_state), nshots=20 @@ -160,7 +162,9 @@ def test_measurement_result_parameters_repeated_execution_final_measurements(bac c.add(gates.RY(0, theta=np.pi * r.symbols[0] / 3)) c.add(gates.RY(2, theta=np.pi * r.symbols[0] / 4)) c.add(gates.M(0, 1, 2, 3)) - result = backend.execute_circuit(c, initial_state=np.copy(initial_state), nshots=30) + result = backend.execute_circuit( + c, initial_state=backend.cast(initial_state, copy=True), nshots=30 + ) final_samples = result.samples(binary=False) backend.set_seed(123) diff --git a/tests/test_measurements_probabilistic.py b/tests/test_measurements_probabilistic.py index 6b018c3f08..13381865f2 100644 --- a/tests/test_measurements_probabilistic.py +++ b/tests/test_measurements_probabilistic.py @@ -43,6 +43,8 @@ def test_sample_frequency_agreement(backend): target_frequencies = result.frequencies(binary=False) samples = result.samples(binary=False) outcomes, counts = np.unique(samples, return_counts=True) + outcomes = backend.to_numpy(outcomes) + counts = backend.to_numpy(counts) frequencies = dict(zip(outcomes, counts)) assert frequencies == target_frequencies diff --git a/tests/test_models_circuit_backpropagation.py b/tests/test_models_circuit_backpropagation.py index 12bccc215a..49ac6a77c5 100644 --- a/tests/test_models_circuit_backpropagation.py +++ b/tests/test_models_circuit_backpropagation.py @@ -22,7 +22,7 @@ def test_variable_backpropagation(): backend = construct_tensorflow_backend() import tensorflow as tf - theta = tf.Variable(0.1234, dtype=tf.complex128) + theta = tf.Variable(0.1234, dtype=tf.float64) # TODO: Fix parametrized gates so that `Circuit` can be defined outside # of the gradient tape with tf.GradientTape() as tape: @@ -45,7 +45,7 @@ def test_two_variables_backpropagation(): backend = construct_tensorflow_backend() import tensorflow as tf - theta = tf.Variable([0.1234, 0.4321], dtype=tf.complex128) + theta = tf.Variable([0.1234, 0.4321], dtype=tf.float64) # TODO: Fix parametrized gates so that `Circuit` can be defined outside # of the gradient tape with tf.GradientTape() as tape: diff --git a/tests/test_models_circuit_parametrized.py b/tests/test_models_circuit_parametrized.py index c9ac4990bc..6bc1698321 100644 --- a/tests/test_models_circuit_parametrized.py +++ b/tests/test_models_circuit_parametrized.py @@ -227,8 +227,8 @@ def test_variable_theta(): import tensorflow as tf # pylint: disable=import-error - theta1 = tf.Variable(0.1234, dtype=tf.complex128) - theta2 = tf.Variable(0.4321, dtype=tf.complex128) + theta1 = tf.Variable(0.1234, dtype=tf.float64) + theta2 = tf.Variable(0.4321, dtype=tf.float64) cvar = Circuit(2) cvar.add(gates.RX(0, theta1)) cvar.add(gates.RY(1, theta2)) diff --git a/tests/test_models_circuit_qasm.py b/tests/test_models_circuit_qasm.py index 39c4e4c44f..43d15fd8c5 100644 --- a/tests/test_models_circuit_qasm.py +++ b/tests/test_models_circuit_qasm.py @@ -533,8 +533,10 @@ def alice(q0, q1): gate.append(bob(-np.pi / 4, np.pi / 2, q0, q1)) return gate - backend.assert_allclose(c.queue[0].matrix(), bob(-np.pi / 2, np.pi, 0, 2).matrix()) - backend.assert_allclose(c.queue[1].matrix(), alice(1, 0).matrix()) + backend.assert_allclose( + c.queue[0].matrix(backend), bob(-np.pi / 2, np.pi, 0, 2).matrix(backend) + ) + backend.assert_allclose(c.queue[1].matrix(backend), alice(1, 0).matrix(backend)) def test_from_qasm_unsupported_statement(): diff --git a/tests/test_models_dbi.py b/tests/test_models_dbi.py index 4e17fa2009..3ce40e6559 100644 --- a/tests/test_models_dbi.py +++ b/tests/test_models_dbi.py @@ -3,21 +3,31 @@ import numpy as np import pytest +from qibo import hamiltonians, set_backend from qibo.hamiltonians import Hamiltonian from qibo.models.dbi.double_bracket import ( + DoubleBracketCostFunction, DoubleBracketGeneratorType, DoubleBracketIteration, + DoubleBracketScheduling, ) +from qibo.models.dbi.utils import * +from qibo.models.dbi.utils_dbr_strategies import ( + gradient_descent, + select_best_dbr_generator, +) +from qibo.models.dbi.utils_scheduling import polynomial_step from qibo.quantum_info import random_hermitian -NSTEPS = 50 -SEED = 10 +NSTEPS = 3 +seed = 10 """Number of steps for evolution.""" @pytest.mark.parametrize("nqubits", [1, 2]) def test_double_bracket_iteration_canonical(backend, nqubits): - h0 = random_hermitian(2**nqubits, backend=backend) + """Check default (canonical) mode.""" + h0 = random_hermitian(2**nqubits, backend=backend, seed=seed) dbi = DoubleBracketIteration( Hamiltonian(nqubits, h0, backend=backend), mode=DoubleBracketGeneratorType.canonical, @@ -31,7 +41,8 @@ def test_double_bracket_iteration_canonical(backend, nqubits): @pytest.mark.parametrize("nqubits", [1, 2]) def test_double_bracket_iteration_group_commutator(backend, nqubits): - h0 = random_hermitian(2**nqubits, backend=backend, seed=SEED) + """Check group commutator mode.""" + h0 = random_hermitian(2**nqubits, backend=backend, seed=seed) d = backend.cast(np.diag(np.diag(backend.to_numpy(h0)))) dbi = DoubleBracketIteration( Hamiltonian(nqubits, h0, backend=backend), @@ -41,39 +52,35 @@ def test_double_bracket_iteration_group_commutator(backend, nqubits): # test first iteration with default d dbi(mode=DoubleBracketGeneratorType.group_commutator, step=0.01) - for _ in range(NSTEPS): dbi(step=0.01, d=d) assert initial_off_diagonal_norm > dbi.off_diagonal_norm -@pytest.mark.parametrize("nqubits", [3]) -def test_double_bracket_iteration_eval_dbr_unitary(backend, nqubits): - r"""The bound is $$||e^{-[D,H]}-GC||\le s^{3/2}(||[H,[D,H]||+||[D,[D,H]]||$$""" - h0 = random_hermitian(2**nqubits, backend=backend) +@pytest.mark.parametrize("nqubits", [1, 2]) +def test_double_bracket_iteration_group_commutator_3rd_order(backend, nqubits): + """Check 3rd order group commutator mode.""" + h0 = random_hermitian(2**nqubits, backend=backend, seed=seed) d = backend.cast(np.diag(np.diag(backend.to_numpy(h0)))) dbi = DoubleBracketIteration( Hamiltonian(nqubits, h0, backend=backend), - mode=DoubleBracketGeneratorType.group_commutator, + mode=DoubleBracketGeneratorType.group_commutator_third_order, ) + initial_off_diagonal_norm = dbi.off_diagonal_norm - for s in np.linspace(0.001, 0.01, NSTEPS): - u = dbi.eval_dbr_unitary( - s, d=d, mode=DoubleBracketGeneratorType.single_commutator - ) - v = dbi.eval_dbr_unitary( - s, d=d, mode=DoubleBracketGeneratorType.group_commutator - ) + # test first iteration with default d + dbi(mode=DoubleBracketGeneratorType.group_commutator_third_order, step=0.01) + for _ in range(NSTEPS): + dbi(step=0.01, d=d) - assert np.linalg.norm(u - v) < 10 * s**1.49 * ( - np.linalg.norm(h0) + np.linalg.norm(d) - ) * np.linalg.norm(h0) * np.linalg.norm(d) + assert initial_off_diagonal_norm > dbi.off_diagonal_norm @pytest.mark.parametrize("nqubits", [1, 2]) def test_double_bracket_iteration_single_commutator(backend, nqubits): - h0 = random_hermitian(2**nqubits, backend=backend) + """Check single commutator mode.""" + h0 = random_hermitian(2**nqubits, backend=backend, seed=seed) d = backend.cast(np.diag(np.diag(backend.to_numpy(h0)))) dbi = DoubleBracketIteration( Hamiltonian(nqubits, h0, backend=backend), @@ -90,49 +97,190 @@ def test_double_bracket_iteration_single_commutator(backend, nqubits): assert initial_off_diagonal_norm > dbi.off_diagonal_norm -@pytest.mark.parametrize("nqubits", [3, 4]) -def test_hyperopt_step(backend, nqubits): - h0 = random_hermitian(2**nqubits, backend=backend) - d = backend.cast(np.diag(np.diag(backend.to_numpy(h0)))) - dbi = DoubleBracketIteration(Hamiltonian(nqubits, h0, backend=backend)) +@pytest.mark.parametrize("nqubits", [2, 3]) +@pytest.mark.parametrize( + "scheduling", + [ + DoubleBracketScheduling.grid_search, + DoubleBracketScheduling.hyperopt, + DoubleBracketScheduling.simulated_annealing, + ], +) +def test_variational_scheduling(backend, nqubits, scheduling): + """Check schduling options.""" + h = 2 + # define the hamiltonian + h0 = hamiltonians.TFIM(nqubits=nqubits, h=h) + dbi = DoubleBracketIteration(h0, scheduling=scheduling) # find initial best step with look_ahead = 1 - initial_step = 0.01 - delta = 0.02 + initial_off_diagonal_norm = dbi.off_diagonal_norm + for _ in range(NSTEPS): + step = dbi.choose_step() + dbi(step=step) + assert initial_off_diagonal_norm > dbi.off_diagonal_norm - step = dbi.hyperopt_step( - step_min=initial_step - delta, step_max=initial_step + delta, max_evals=10 + +@pytest.mark.parametrize( + "cost", + [ + DoubleBracketCostFunction.off_diagonal_norm, + DoubleBracketCostFunction.least_squares, + ], +) +def test_polynomial_cost_function(backend, cost): + nqubits = 2 + h0 = random_hermitian(2**nqubits, backend=backend, seed=seed) + dbi = DoubleBracketIteration( + Hamiltonian(nqubits, h0, backend=backend), + mode=DoubleBracketGeneratorType.single_commutator, + cost=cost, + scheduling=DoubleBracketScheduling.polynomial_approximation, ) + initial_off_diagonal_norm = dbi.off_diagonal_norm + for i in range(NSTEPS): + s = dbi.choose_step(d=dbi.diagonal_h_matrix, n=5) + dbi(step=s, d=dbi.off_diag_h) + assert initial_off_diagonal_norm > dbi.off_diagonal_norm - assert step != initial_step - # evolve following the optimized first step - for generator in DoubleBracketGeneratorType: - dbi(mode=generator, step=step, d=d) +def test_polynomial_energy_fluctuation(backend): + nqubits = 4 + h0 = random_hermitian(2**nqubits, seed=seed, backend=backend) + state = np.zeros(2**nqubits) + state[0] = 1 + dbi = DoubleBracketIteration( + Hamiltonian(nqubits, h0, backend=backend), + mode=DoubleBracketGeneratorType.single_commutator, + cost=DoubleBracketCostFunction.energy_fluctuation, + scheduling=DoubleBracketScheduling.polynomial_approximation, + ref_state=state, + ) + for i in range(NSTEPS): + s = dbi.choose_step(d=dbi.diagonal_h_matrix, n=5) + dbi(step=s, d=dbi.diagonal_h_matrix) + assert dbi.energy_fluctuation(state=state) < dbi.h0.energy_fluctuation(state=state) - # find the following step size with look_ahead - look_ahead = 3 - step = dbi.hyperopt_step( - step_min=initial_step - delta, - step_max=initial_step + delta, - max_evals=10, - look_ahead=look_ahead, +@pytest.mark.parametrize("nqubits", [5, 6]) +def test_polynomial_fail_cases(backend, nqubits): + h0 = random_hermitian(2**nqubits, backend=backend, seed=seed) + dbi = DoubleBracketIteration( + Hamiltonian(nqubits, h0, backend=backend), + mode=DoubleBracketGeneratorType.single_commutator, + scheduling=DoubleBracketScheduling.polynomial_approximation, ) + with pytest.raises(ValueError): + polynomial_step(dbi, n=2, n_max=1) + assert polynomial_step(dbi, n=1) == None - # evolve following the optimized first step - for gentype in range(look_ahead): - dbi(mode=DoubleBracketGeneratorType(gentype + 1), step=step, d=d) +def test_least_squares(backend): + """Check least squares cost function.""" + nqubits = 4 + h0 = random_hermitian(2**nqubits, backend=backend, seed=seed) + dbi = DoubleBracketIteration( + Hamiltonian(nqubits, h0, backend=backend), + cost=DoubleBracketCostFunction.least_squares, + ) + d = np.diag(np.linspace(1, 2**nqubits, 2**nqubits)) / 2**nqubits + initial_potential = dbi.least_squares(d=d) + step = dbi.choose_step(d=d) + dbi(d=d, step=step) + assert dbi.least_squares(d=d) < initial_potential + + +@pytest.mark.parametrize("compare_canonical", [True, False]) +@pytest.mark.parametrize("step", [None, 1e-3]) +@pytest.mark.parametrize("nqubits", [2, 3]) +def test_select_best_dbr_generator(backend, nqubits, step, compare_canonical): + h0 = random_hermitian(2**nqubits, backend=backend, seed=seed) + dbi = DoubleBracketIteration( + Hamiltonian(nqubits, h0, backend=backend), + mode=DoubleBracketGeneratorType.single_commutator, + ) + initial_off_diagonal_norm = dbi.off_diagonal_norm + generate_local_Z = generate_Z_operators(nqubits, backend=backend) + Z_ops = list(generate_local_Z.values()) + for _ in range(NSTEPS): + dbi, idx, step, flip_sign = select_best_dbr_generator( + dbi, + Z_ops, + compare_canonical=compare_canonical, + step=step, + ) + assert dbi.off_diagonal_norm < initial_off_diagonal_norm -def test_energy_fluctuations(backend): - h0 = np.array([[1, 0], [0, -1]]) - h0 = backend.cast(h0, dtype=backend.dtype) - state = np.array([1, 0]) - state = backend.cast(state, dtype=backend.dtype) +@pytest.mark.parametrize("step", [None, 1e-3]) +def test_params_to_diagonal_operator(backend, step): + nqubits = 2 + pauli_operator_dict = generate_pauli_operator_dict( + nqubits, parameterization_order=1, backend=backend + ) + params = [1, 2, 3] + operator_pauli = sum( + [params[i] * list(pauli_operator_dict.values())[i] for i in range(nqubits)] + ) + backend.assert_allclose( + operator_pauli, + params_to_diagonal_operator( + params, + nqubits=nqubits, + parameterization=ParameterizationTypes.pauli, + pauli_operator_dict=pauli_operator_dict, + ), + ) + operator_element = params_to_diagonal_operator( + params, + nqubits=nqubits, + parameterization=ParameterizationTypes.computational, + ) + for i in range(len(params)): + backend.assert_allclose( + backend.cast(backend.to_numpy(operator_element).diagonal())[i], params[i] + ) - dbi = DoubleBracketIteration(Hamiltonian(1, matrix=h0, backend=backend)) - energy_fluctuation = dbi.energy_fluctuation(state=state) - assert energy_fluctuation == 0 +@pytest.mark.parametrize("order", [1, 2]) +def test_gradient_descent(backend, order): + nqubits = 2 + h0 = random_hermitian(2**nqubits, seed=seed, backend=backend) + dbi = DoubleBracketIteration( + Hamiltonian(nqubits, h0, backend=backend), + mode=DoubleBracketGeneratorType.single_commutator, + scheduling=DoubleBracketScheduling.hyperopt, + cost=DoubleBracketCostFunction.off_diagonal_norm, + ) + initial_off_diagonal_norm = dbi.off_diagonal_norm + pauli_operator_dict = generate_pauli_operator_dict( + nqubits, + parameterization_order=order, + backend=backend, + ) + pauli_operators = list(pauli_operator_dict.values()) + # let initial d be approximation of $\Delta(H) + d_coef_pauli = decompose_into_pauli_basis( + dbi.diagonal_h_matrix, pauli_operators=pauli_operators + ) + d_pauli = sum([d_coef_pauli[i] * pauli_operators[i] for i in range(nqubits)]) + loss_hist_pauli, d_params_hist_pauli, s_hist_pauli = gradient_descent( + dbi, + NSTEPS, + d_coef_pauli, + ParameterizationTypes.pauli, + pauli_operator_dict=pauli_operator_dict, + pauli_parameterization_order=order, + ) + assert loss_hist_pauli[-1] < initial_off_diagonal_norm + + # computational basis + d_coef_computational_partial = backend.cast(backend.to_numpy(d_pauli).diagonal()) + ( + loss_hist_computational_partial, + _, + _, + ) = gradient_descent( + dbi, NSTEPS, d_coef_computational_partial, ParameterizationTypes.computational + ) + assert loss_hist_computational_partial[-1] < initial_off_diagonal_norm diff --git a/tests/test_models_dbi_utils.py b/tests/test_models_dbi_utils.py deleted file mode 100644 index 9f55171547..0000000000 --- a/tests/test_models_dbi_utils.py +++ /dev/null @@ -1,51 +0,0 @@ -""""Testing utils for DoubleBracketIteration model""" - -import numpy as np -import pytest - -from qibo.hamiltonians import Hamiltonian -from qibo.models.dbi.double_bracket import ( - DoubleBracketGeneratorType, - DoubleBracketIteration, -) -from qibo.models.dbi.utils import * -from qibo.quantum_info import random_hermitian - -NSTEPS = 5 -"""Number of steps for evolution.""" - - -@pytest.mark.parametrize("nqubits", [1, 2]) -def test_generate_Z_operators(backend, nqubits): - h0 = random_hermitian(2**nqubits, backend=backend) - dbi = DoubleBracketIteration( - Hamiltonian(nqubits=nqubits, matrix=h0, backend=backend) - ) - generate_Z = generate_Z_operators(nqubits, backend=backend) - Z_ops = list(generate_Z.values()) - - delta_h0 = dbi.diagonal_h_matrix - dephasing_channel = (sum([Z_op @ h0 @ Z_op for Z_op in Z_ops]) + h0) / 2**nqubits - norm_diff = np.linalg.norm(delta_h0 - dephasing_channel) - - assert norm_diff < 1e-3 - - -@pytest.mark.parametrize("nqubits", [1, 2]) -@pytest.mark.parametrize("step", [0.1, 0.2]) -def test_select_best_dbr_generator(backend, nqubits, step): - h0 = random_hermitian(2**nqubits, seed=1, backend=backend) - dbi = DoubleBracketIteration( - Hamiltonian(nqubits, h0, backend=backend), - mode=DoubleBracketGeneratorType.single_commutator, - ) - generate_Z = generate_Z_operators(nqubits, backend=backend) - Z_ops = list(generate_Z.values()) - initial_off_diagonal_norm = dbi.off_diagonal_norm - - for _ in range(NSTEPS): - dbi, idx, step_optimize, flip = select_best_dbr_generator( - dbi, Z_ops, step=step, compare_canonical=True, max_evals=5 - ) - - assert initial_off_diagonal_norm > dbi.off_diagonal_norm diff --git a/tests/test_models_variational.py b/tests/test_models_variational.py index 54c731aabd..2ee1d2bc59 100644 --- a/tests/test_models_variational.py +++ b/tests/test_models_variational.py @@ -92,7 +92,7 @@ def myloss(parameters, circuit, target): ("BFGS", {"maxiter": 1}, False, "vqe_bfgs.out"), ("parallel_L-BFGS-B", {"maxiter": 1}, True, None), ("parallel_L-BFGS-B", {"maxiter": 1}, False, None), - ("cma", {"maxfevals": 2}, False, None), + ("cma", {"maxiter": 1}, False, None), ("sgd", {"nepochs": 5}, False, None), ("sgd", {"nepochs": 5}, True, None), ] @@ -128,8 +128,19 @@ def test_vqe(backend, method, options, compile, filename): np.random.seed(0) initial_parameters = np.random.uniform(0, 2 * np.pi, 2 * nqubits * layers + nqubits) v = models.VQE(circuit, hamiltonian) + + loss_values = [] + + def callback(parameters, loss_values=loss_values, vqe=v): + vqe.circuit.set_parameters(parameters) + loss_values.append(vqe.hamiltonian.expectation(vqe.circuit().state())) + best, params, _ = v.minimize( - initial_parameters, method=method, options=options, compile=compile + initial_parameters, + method=method, + options=options, + compile=compile, + callback=callback, ) if method == "cma": # remove `outcmaes` folder @@ -138,6 +149,7 @@ def test_vqe(backend, method, options, compile, filename): shutil.rmtree("outcmaes") if filename is not None: assert_regression_fixture(backend, params, filename) + assert best == min(loss_values) # test energy fluctuation state = backend.np.ones(2**nqubits) / np.sqrt(2**nqubits) @@ -299,7 +311,7 @@ def __call__(self, x): test_names = "method,options,compile,filename" test_values = [ ("BFGS", {"maxiter": 1}, False, "aavqe_bfgs.out"), - ("cma", {"maxfevals": 2}, False, None), + ("cma", {"maxiter": 1}, False, None), ("parallel_L-BFGS-B", {"maxiter": 1}, False, None), ] diff --git a/tests/test_quantum_info_clifford.py b/tests/test_quantum_info_clifford.py index 9166d3ad0c..c9e8654df9 100644 --- a/tests/test_quantum_info_clifford.py +++ b/tests/test_quantum_info_clifford.py @@ -4,7 +4,7 @@ import numpy as np import pytest -from qibo import Circuit, gates +from qibo import Circuit, gates, matrices from qibo.backends import CliffordBackend, PyTorchBackend, TensorflowBackend from qibo.backends.clifford import _get_engine_name from qibo.quantum_info._clifford_utils import ( @@ -152,9 +152,10 @@ def test_clifford_stabilizers(backend, symplectic, return_array): obj = Clifford.from_circuit(c, engine=_get_engine_name(backend)) if return_array: true_generators = [ - reduce(np.kron, [getattr(gates, gate)(0).matrix() for gate in generator]) + reduce(np.kron, [getattr(matrices, gate) for gate in generator]) for generator in ["XII", "IZI", "IIZ"] ] + true_generators = backend.cast(true_generators, dtype=true_generators[0].dtype) else: true_generators = ["XII", "IZI", "IIZ"] true_phases = [1, 1, -1] @@ -181,12 +182,13 @@ def test_clifford_stabilizers(backend, symplectic, return_array): "-IIZ", "III", ]: - tmp = reduce( - np.kron, [getattr(gates, s)(0).matrix() for s in stab.replace("-", "")] - ) + tmp = reduce(np.kron, [getattr(matrices, s) for s in stab.replace("-", "")]) if "-" in stab: tmp *= -1 true_stabilizers.append(tmp) + true_stabilizers = backend.cast( + true_stabilizers, dtype=true_stabilizers[0].dtype + ) elif not symplectic and not return_array: true_stabilizers = [ "-XZZ", @@ -220,10 +222,10 @@ def test_clifford_destabilizers(backend, symplectic, return_array): obj = Clifford.from_circuit(c, engine=_get_engine_name(backend)) if return_array: true_generators = [ - reduce(np.kron, [getattr(gates, gate)(0).matrix() for gate in generator]) + reduce(np.kron, [getattr(matrices, gate) for gate in generator]) for generator in ["ZII", "IXI", "IIX"] ] - true_generators = backend.cast(true_generators) + true_generators = backend.cast(true_generators, dtype=true_generators[0].dtype) else: true_generators = ["ZII", "IXI", "IIX"] true_phases = [1, 1, 1] @@ -252,11 +254,14 @@ def test_clifford_destabilizers(backend, symplectic, return_array): ]: tmp = reduce( np.kron, - [getattr(gates, s)(0).matrix() for s in destab.replace("-", "")], + [getattr(matrices, s) for s in destab.replace("-", "")], ) if "-" in destab: tmp *= -1 true_destabilizers.append(tmp) + true_destabilizers = backend.cast( + true_destabilizers, dtype=true_destabilizers[0].dtype + ) elif not symplectic and not return_array: true_destabilizers = [ "ZXX", diff --git a/tests/test_quantum_info_random.py b/tests/test_quantum_info_random.py index 27c250765e..f974f57dd3 100644 --- a/tests/test_quantum_info_random.py +++ b/tests/test_quantum_info_random.py @@ -9,7 +9,6 @@ from qibo.config import PRECISION_TOL from qibo.quantum_info.metrics import purity from qibo.quantum_info.random_ensembles import ( - _probability_distribution_sin, random_clifford, random_density_matrix, random_gaussian_matrix, diff --git a/tests/test_result.py b/tests/test_result.py index 53d274d896..822006ba80 100644 --- a/tests/test_result.py +++ b/tests/test_result.py @@ -91,12 +91,11 @@ def test_circuitresult_dump_load(backend, agnostic_load): # set probabilities to trigger the warning result._probs = result.probabilities() result.dump("tmp.npy") - if agnostic_load: - loaded_res = load_result("tmp.npy") - else: - loaded_res = CircuitResult.load("tmp.npy") + loaded_res = ( + load_result("tmp.npy") if agnostic_load else CircuitResult.load("tmp.npy") + ) loaded_freq = loaded_res.frequencies() for state, f in freq.items(): assert loaded_freq[state] == f - assert backend.np.sum(result.state() - loaded_res.state()) == 0 + assert backend.np.sum(result.state() - backend.cast(loaded_res.state())) == 0 remove("tmp.npy") diff --git a/tests/test_transpiler_unitary_decompositions.py b/tests/test_transpiler_unitary_decompositions.py index c72591c72c..6b6c0f4e3e 100644 --- a/tests/test_transpiler_unitary_decompositions.py +++ b/tests/test_transpiler_unitary_decompositions.py @@ -80,7 +80,7 @@ def test_v_decomposition(backend, seed): calculate_psi(unitary, backend=backend) else: psi, _ = calculate_psi(unitary, backend=backend) - va, vb = calculate_single_qubit_unitaries(psi) + va, vb = calculate_single_qubit_unitaries(psi, backend=backend) assert_single_qubits(backend, psi, va, vb) @@ -94,7 +94,9 @@ def test_u_decomposition(backend, seed): else: psi, eigvals = calculate_psi(unitary, backend=backend) psi_tilde = np.conj(np.sqrt(eigvals)) * np.dot(unitary, psi) - ua_dagger, ub_dagger = calculate_single_qubit_unitaries(psi_tilde) + ua_dagger, ub_dagger = calculate_single_qubit_unitaries( + psi_tilde, backend=backend + ) assert_single_qubits(backend, psi_tilde, ua_dagger, ub_dagger) @@ -140,7 +142,7 @@ def test_cnot_decomposition(backend): hx, hy, hz = np.random.random(3) target_matrix = bell_unitary(hx, hy, hz) c = Circuit(2) - c.add(cnot_decomposition(0, 1, hx, hy, hz)) + c.add(cnot_decomposition(0, 1, hx, hy, hz, backend)) final_matrix = c.unitary(backend) backend.assert_allclose(final_matrix, target_matrix, atol=PRECISION_TOL) @@ -149,7 +151,7 @@ def test_cnot_decomposition_light(backend): hx, hy = np.random.random(2) target_matrix = bell_unitary(hx, hy, 0) c = Circuit(2) - c.add(cnot_decomposition_light(0, 1, hx, hy)) + c.add(cnot_decomposition_light(0, 1, hx, hy, backend)) final_matrix = c.unitary(backend) backend.assert_allclose(final_matrix, target_matrix, atol=PRECISION_TOL)