From 3bb2fa5cfd37310f7cec40cdeff3a69bc8b6c3b5d96e1ac9b4627280febffb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Tue, 24 Sep 2024 08:46:49 +0000 Subject: [PATCH] - Switch to testing in multibuild: The obs runtime requirement resolver deals with numba/numpy blockage more gracefully than trying to resolve a BuildRequires on them. Numba 0.60 is restricted to Numpy < 2.1 right now. * Update requirements OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-quimb?expand=0&rev=21 --- .gitattributes | 23 +++ .gitignore | 1 + _multibuild | 3 + python-quimb.changes | 377 +++++++++++++++++++++++++++++++++++++++++++ python-quimb.spec | 118 ++++++++++++++ quimb-1.7.3.tar.gz | 3 + quimb-1.8.4.tar.gz | 3 + 7 files changed, 528 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 python-quimb.changes create mode 100644 python-quimb.spec create mode 100644 quimb-1.7.3.tar.gz create mode 100644 quimb-1.8.4.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-quimb.changes b/python-quimb.changes new file mode 100644 index 0000000..330cace --- /dev/null +++ b/python-quimb.changes @@ -0,0 +1,377 @@ +------------------------------------------------------------------- +Mon Sep 23 19:48:30 UTC 2024 - Ben Greiner + +- Switch to testing in multibuild: The obs runtime requirement + resolver deals with numba/numpy blockage more gracefully than + trying to resolve a BuildRequires on them. Numba 0.60 is + restricted to Numpy < 2.1 right now. +* Update requirements + +------------------------------------------------------------------- +Sat Aug 31 11:54:18 UTC 2024 - Dirk Müller + +- update to 1.8.4: + * support for numpy v2.0 and scipy v1.14 + * add MPS sampling: `MatrixProductState.sample_configuration` + and `MatrixProductState.sample` (generating multiple samples) + and use these for `CircuitMPS.sample` and + `CircuitPermMPS.sample`. + * add basic `.plot()` method for SimpleUpdate classes + * add `edges_1d_chain` for generating 1D chain edges + * operatorbuilder: better coefficient placement for long range + MPO building + * `TNOptimizer` can now accept an arbitrary pytree (nested + combination of dicts, lists, tuples, etc. with + `TensorNetwork`, `Tensor` or raw `array_like` objects as the + leaves) as the target object to optimize. + * `TNOptimizer` can now directly optimize `Circuit` objects, + returning a new optimized circuit with updated parameters. + * `Circuit`: add `.copy()`, `.get_params()` and `.set_params()` + interface methods. + * Update generic TN optimizer docs. + * add `tn.gen_inds_loops` for generating all loops of indices + in a TN. + * add `tn.gen_inds_connected` for generating all connected sets + of indices in a TN. + * make SVD fallback error catching more generic ({pull}`#238`) + * fix some windows + numba CI issues. + * `approx_spectral_function` add plotting and tracking + * add dispatching to various tensor primitives to allow + overriding + * `CircuitMPS` now supports multi qubit gates, including + arbitrary multi-controls (which are treated in a low-rank + manner), and faster simulation via better orthogonality + center tracking. + * add `CircuitPermMPS` + * add `MatrixProductState.gate_nonlocal` for applying a gate, + supplied as a raw matrix, to a non-local and arbitrary number + of sites. The kwarg `contract="nonlocal"` can be used to + force this method, or the new option `"auto-mps"` will select + this method if the gate is non-local ({issue}`230`) + * add `MatrixProductState.gate_with_mpo` for applying an MPO to + an MPS, and immediately compressing back to MPS form using + `tensor_network_1d_compress` + * add `MatrixProductState.gate_with_submpo` for applying an MPO + acting only of a subset of sites to an MPS + * add `MatrixProductOperator.from_dense` for constructing MPOs + from dense matrices, including an only subset of sites + * add `MatrixProductOperator.fill_empty_sites` for 'completing' + an MPO which only has tensors on a subset of sites with (by + default) identities + * `MatrixProductState` and `MatrixProductOperator`, now + support the ``sites`` kwarg in common constructors, enabling + the TN to act on a subset of the full ``L`` sites. + * add `TensorNetwork.drape_bond_between` for 'draping' an + existing bond between two tensors through a third + * add `Tensor.new_ind_pair_with_identity` + * TN2D, TN3D and arbitrary geom classical partition function + builders (`TN_classical_partition_function_from_edges`) now + all support `outputs=` kwarg specifying non-marginalized + variables + * add simple dense 1-norm belief propagation algorithm `D1BP` + * add `qtn.enforce_1d_like` for checking whether a tensor + network is 1D-like, including automatically adding strings of + identities between non-local bonds, expanding applicability + of `tensor_network_1d_compress` + * add `MatrixProductState.canonicalize` as (by default *non- + inplace*) version of `canonize`, to follow the pattern of + other tensor network methods. `canonize` is now an alias for + `canonicalize_` [note trailing underscore]. + * add `MatrixProductState.left_canonicalize` as (by default + *non-inplace*) version of `left_canonize`, to follow the + pattern of other tensor network methods. `left_canonize` is + now an alias for `left_canonicalize_` [note trailing + underscore]. + * add `MatrixProductState.right_canonicalize` as (by default + *non-inplace*) version of `right_canonize`, to follow the + pattern of other tensor network methods. `right_canonize` is + now an alias for `right_canonicalize_` [note trailing + underscore]. + * add `quimb.tensor.tensor_1d_compress.py` with functions for + compressing generic + * fix scipy sparse monkey patch for scipy>=1.13 ({issue}`222`) + * fix autoblock bug where connected sectors were not being + merged ({issue}`223`) + +------------------------------------------------------------------- +Tue Feb 27 20:12:07 UTC 2024 - Ben Greiner + +- Update to 1.7.3 + ## Enhancements: + * qu.randn: support dist="rademacher". + * support dist and other randn options in various TN builders. + ## Bug fixes: + * restore fallback (to scipy.linalg.svd with driver='gesvd') + behavior for truncated SVD with numpy backend. +- Release 1.7.2 + ## Bug fixes: + * removed import of deprecated numba.generated_jit decorator. + ## Enhancements: + * add normalized=True option to tensor_network_distance for + computing the normalized distance between tensor networks, + which is useful for convergence checks. + Tensor.distance_normalized and + TensorNetwork.distance_normalized added as aliases. + * add TensorNetwork.cut_bond for cutting a bond index +- Release v1.7.1 + ## Enhancements: + * add TensorNetwork.visualize_tensors for visualizing the actual + data entries of an entire tensor network. + * add ham.build_mpo_propagator_trotterized for building a + trotterized propagator from a local 1D hamiltonian. This also + includes updates for creating 'empty' tensor networks using + TensorNetwork.new, and building up gates from empty tensor + networks using TensorNetwork.gate_inds_with_tn. + * add more options to Tensor.expand_ind and Tensor.new_ind: + repeat tiling mode and random padding mode. + * tensor decomposition: make eigh_truncated backend agnostic. + * tensor_compress_bond: add reduced="left" and reduced="right" + modes for when the pair of tensors is already in a canonical + form. + * add qtn.TN2D_embedded_classical_ising_partition_function for + constructing 2D (triangular) tensor networks representing + all-to-all classical ising partition functions. + ## Bug fixes: + * fix bug in kruas_op when operator spanned multiple subsystems + (#214) + * fix bug in qr_stabilized when the diagonal of R has significant + imaginary parts. + * fix bug in quantum discord computation when the state was + diagonal (#217) + * Fix empty lines in dimacs by @jjcmoon in #215 +- Release 1.7.0 + ## Breaking Changes + * Circuit : remove target_size in preparation for all contraction + specifications to be encapsulated at the contract level (e.g. + with cotengra) some TN drawing options (mainly arrow options) + have changed due to the backend change detailed below. + ## Enhancements: + * Multi tag drawing support + * TensorNetwork.draw: use quimb.schematic for main + backend="matplotlib" drawing. Enabling: + - multi tag coloring for single tensors + - arrows and labels on multi-edges + - better sizing of tensors using absolute units + - neater single tensor drawing, in 2D and 3D + * add quimb.schematic.Drawing from experimental submodule, add + example docs at schematic. Add methods text_between, wedge, + line_offset and other tweaks for future use by main TN drawing. + * upgrade all contraction to use cotengra as the backend + * Circuit : allow any gate to be controlled by any number of + qubits. + * Circuit : support for parsing openqasm2 specifications now with + custom and nested gate definitions etc. + * add is_cyclic_x, is_cyclic_y) and is_cyclic_z to + TensorNetwork2D and TensorNetwork3D. + * add TensorNetwork.compress_all_1d for compressing generic + tensor networks that you promise have a 1D topology, without + casting as a TensorNetwork1D. + * add MatrixProductState.from_fill_fn for constructing MPS from a + function that fills the tensors. + * add Tensor.idxmin and Tensor.idxmax for finding the index of + the minimum / maximum element. + * 2D and 3D classical partition function TN builders: allow + output indices. + * quimb.experimental.belief_propagation: add various + 1-norm/2-norm dense/lazy BP algorithms. + ## Bug fixes: + * fixed bug where an output index could be removed by squeezing + when performing tensor network simplifications. + * Fix deprecation warnings by @king-p3nguin in #209 +- Release v1.6.0 + ## Breaking Changes + * Quantum circuit RZZ definition corrected (angle changed by -1/2 + to match qiskit). + ## Enhancements: + * add OpenQASM 2.0 parsing support: + :meth:Circuit.from_openqasm2_file + * :class:Circuit: add RXX, RYY, CRX, CRY, CRZ, toffoli, fredkin, + givens gates + * truncate TN pretty html reprentation to 100 tensors for + performance + * add :meth:Tensor.sum_reduce and :meth:Tensor.vector_reduce + * :meth:contract_compressed, default to 'virtual-tree' gauge + * add :func:TN_rand_tree + * experimental.operatorbuilder: fix parallel and heisenberg + builder + * make parametrized gate generation even more robost (ensure + matching types so e.g. tensorflow can be used) + ## Bug fixes: + * fix gauge size check for some backends +- Release 1.5.1 + * add various MPO-MPS gate methods, including zip-up and density + matrix, in the experimental submodule + * some PTensor refactoring + * Circuit: more robust parametrized gate generation + * various new contraction convenience interfaces (incld. + array_contract) + * add Tensor.check() and TensorNetwork.check() for diagnostics + * add TensorNetwork.isconnected(), TensorNetwork.istree() +- Release 1.5.0 + ## Enhancements + * refactor 'isometrize' methods including new "cayley", + "householder" and "torch_householder" methods. See + :func:quimb.tensor.decomp.isometrize. + * add + :meth:~quimb.tensor.tensor_core.TensorNetwork.compute_reduced_factor + and + :meth:~quimb.tensor.tensor_core.TensorNetwork.insert_compressor_between_regions + methos, for some RG style algorithms. + * add the mode="projector" option for 2D tensor network + contractions + * add HOTRG style coarse graining and contraction in 2D and 3D. + See + :meth:~quimb.tensor.tensor_2d.TensorNetwork2D.coarse_grain_hotrg, + :meth:~quimb.tensor.tensor_2d.TensorNetwork2D.contract_hotrg, + :meth:~quimb.tensor.tensor_3d.TensorNetwork3D.coarse_grain_hotrg, + and + :meth:~quimb.tensor.tensor_3d.TensorNetwork3D.contract_hotrg, + * add CTMRG style contraction for 2D tensor networks: + :meth:~quimb.tensor.tensor_2d.TensorNetwork2D.contract_ctmrg + * add 2D tensor network 'corner double line' (CDL) builders: + :func:~quimb.tensor.tensor_builder.TN2D_corner_double_line + * update the docs to use the furo _ + theme, myst_nb _ for + notebooks, and several other sphinx extensions. + * add the 'adabelief' optimizer to + :class:~quimb.tensor.optimize.TNOptimizer as well as a quick + plotter: :meth:~quimb.tensor.optimize.TNOptimizer.plot + * add initial 3D plotting methods for tensors networks ( + TensorNetwork.draw(dim=3, backend='matplotlib3d') or + TensorNetwork.draw(dim=3, backend='plotly') ). The new + backend='plotly' can also be used for 2D interactive plots. + * Update :func:~quimb.tensor.tensor_builder.HTN_from_cnf to + handle more weighted model counting formats. + * Add :func:~quimb.tensor.tensor_builder.cnf_file_parse + * Add :func:~quimb.tensor.tensor_builder.random_ksat_instance + * Add :func:~quimb.tensor.tensor_builder.TN_from_strings + * Add :func:~quimb.tensor.tensor_builder.convert_to_2d + * Add :func:~quimb.tensor.tensor_builder.TN2D_rand_hidden_loop + * Add :func:~quimb.tensor.tensor_builder.convert_to_3d + * Add :func:~quimb.tensor.tensor_builder.TN3D_corner_double_line + * Add :func:~quimb.tensor.tensor_builder.TN3D_rand_hidden_loop + * various optimizations for minimizing computational graph size + and + * construction time. + * add 'lu', 'polar_left' and 'polar_right' methods to + :func:~quimb.tensor.tensor_core.tensor_split. + * add experimental arbitrary hamilotonian MPO building + * :class:~quimb.tensor.tensor_core.TensorNetwork: allow empty + constructor (i.e. no tensors representing simply the scalar 1) + * :meth:~quimb.tensor.tensor_core.TensorNetwork.drop_tags: allow + all tags to be dropped + * tweaks to compressed contraction and gauging + * add jax, flax and optax example + * add 3D and interactive plotting of tensors networks with via + plotly. + * add pygraphiviz layout options + * add :meth:~quimb.tensor.tensor_core.TensorNetwork.combine for + unified handling of combining tensor networks potentially with + structure + * add HTML colored pretty printing of tensor networks for + notebooks + * add quimb.experimental.cluster_update.py + ## Bug fixes: + * fix :func:~quimb.tensor.decomp.qr_stabilized bug for strictly + upper triangular R factors. +- Run tests in parallel (rerun flaky precision errors) + +------------------------------------------------------------------- +Thu Jun 1 07:31:29 UTC 2023 - Steve Kowalik + +- Numba now exists for Python 3.11, stop skipping it. + +------------------------------------------------------------------- +Thu Mar 23 06:51:10 UTC 2023 - Ben Greiner + +- Skip python311: no numba yet + +------------------------------------------------------------------- +Thu Feb 2 09:37:02 UTC 2023 - Dirk Müller + +- upgrade opt-einsum to requires as it is imported by tensor/ + unconditionally + +------------------------------------------------------------------- +Sat Jan 14 11:35:41 UTC 2023 - Ben Greiner + +- Update to v1.4.2 + * no relevant code changes for openSUSE users +- Release v1.4.1 + ## Enhancements + * unify much functionality from 1D, 2D and 3D into general + arbitrary geometry class + quimb.tensor.tensor_arbgeom.TensorNetworkGen + * refactor contraction, allowing using cotengra directly + * add visualize() for visualizing the actual data entries of an + arbitrarily high dimensional tensor + * add Gate class for more robust tracking and manipulation of + gates in quantum Circuit simulation + * tweak TN drawing style and layout + * tweak default gauging options of compressed contraction + * add compute_hierarchical_grouping() + * add as_network() + * add inds_size() + * add get_hyperinds() + * add outer_size() + * improve group_inds() + * refactor tensor decompositiona and ‘isometrization’ methods + * begin supporting pytree specifications in TNOptimizer, e.g. for + constants + * add experimental submodule for new sharing features + * register tensor and tensor network objects with jax pytree + interface (PR150) + * update CI infrastructure + ## Bug fixes: + * fix force atlas 2 and weight_attr bug (GH126) + * allow unpickling of PTensor objects (GH128, PR131) +- Release v1.4.0 + ## Enhancements + * Add 2D tensor network support and algorithms + * Add 3D tensor network infrastructure + * Add arbitrary geometry quantum state infrastructure + * Many changes to TNOptimizer + * Many changes to TN drawing + * Many changes to Circuit simulation + * Many improvements to TN simplification + * Make all tag and index operations deterministic + * Add tensor_network_sum(), tensor_network_distance() and fit() + * Various memory and performance improvements + * Various graph generators and TN builders + +------------------------------------------------------------------- +Fri Feb 5 20:13:46 UTC 2021 - Benjamin Greiner + +- Generalize the ExcludeArch into %ix64 %arm ppc s390x + +------------------------------------------------------------------- +Thu Feb 4 22:31:53 UTC 2021 - Benjamin Greiner + +- Disable build for armv7l and s390x + +------------------------------------------------------------------- +Tue Jan 19 09:36:08 UTC 2021 - andy great + +- Disable build for python36 because scipy. + +------------------------------------------------------------------- +Sat Aug 22 07:04:12 UTC 2020 - andy great + +- Clean up spec file. + +------------------------------------------------------------------- +Wed Aug 19 13:39:27 UTC 2020 - andy great + +- Remove noarch macro from spec file. + +------------------------------------------------------------------- +Wed Aug 19 07:07:33 UTC 2020 - andy great + +- Disable build for 32-bit arch because numba and parallel does not + support 32-bit arch. Tried to export variable + "export QUIMB_NUMBA_PARALLEL=off" does not solve the issue. + +------------------------------------------------------------------- +Tue Aug 18 09:36:15 UTC 2020 - andy great + +- Initial package release. diff --git a/python-quimb.spec b/python-quimb.spec new file mode 100644 index 0000000..f0cff50 --- /dev/null +++ b/python-quimb.spec @@ -0,0 +1,118 @@ +# +# spec file for package python-quimb +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} +%if "%{flavor}" == "" +%define psuffix %{nil} +%bcond_with test +BuildArch: noarch +%else +%bcond_without test +%define psuffix -%{flavor} +# This package does not support 32 bit arch, s390x fails too +ExcludeArch: %{ix86} %{arm} ppc s390x +%endif + +Name: python-quimb%{psuffix} +Version: 1.8.4 +Release: 0 +Summary: Python library for quantum information and many-body calculations +License: Apache-2.0 +URL: https://quimb.readthedocs.io/ +Source: https://github.com/jcmgray/quimb/archive/refs/tags/v%{version}.tar.gz#/quimb-%{version}.tar.gz +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools_scm} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-autoray >= 0.6.12 +Requires: python-cotengra >= 0.6.1 +Requires: python-cytoolz >= 0.8.0 +Requires: python-numba >= 0.39 +Requires: python-numpy >= 1.17 +Requires: python-psutil >= 4.3.1 +Requires: python-scipy >= 1.0.0 +Requires: python-tqdm >= 4 +Requires(post): update-alternatives +Requires(postun): update-alternatives +Recommends: python-diskcache >= 3.0 +Recommends: python-matplotlib >= 2 +Recommends: python-networkx >= 2.3 +Suggests: python-mpi4py +Suggests: python-petsc4py +Suggests: python-slepc4py +%if %{with test} +BuildRequires: %{python_module quimb = %{version}} +## +BuildRequires: %{python_module diskcache >= 3.0} +BuildRequires: %{python_module matplotlib >= 2} +BuildRequires: %{python_module networkx >= 2.3} +BuildRequires: %{python_module psutil >= 4.3.1} +BuildRequires: %{python_module pytest-rerunfailures} +BuildRequires: %{python_module pytest-xdist} +BuildRequires: %{python_module pytest} +%endif +%python_subpackages + +%description +quimb is an easy but fast python library for quantum information and +many-body calculations, including with tensor networks. + +%prep +%setup -q -n quimb-%{version} + +sed -i '/addopts/d' pyproject.toml + +%build +%if !%{with test} +export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} +%pyproject_wheel +%endif + +%install +%if !%{with test} +%pyproject_install +%python_clone -a %{buildroot}%{_bindir}/quimb-mpi-python +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%post +%python_install_alternative quimb-mpi-python + +%postun +%python_uninstall_alternative quimb-mpi-python + +%if %{with test} +%check +mv quimb quimb.movedsrc +# precision comparison slightly out of tolerance: this one is permament, others are flaky (rerun them) +donttest="(test_subtract_update and float32)" +%pytest -n auto --reruns 3 -k "not ($donttest)" +%endif + +%if !%{with test} +%files %{python_files} +%doc README.md +%license LICENSE.txt +%python_alternative %{_bindir}/quimb-mpi-python +%{python_sitelib}/quimb-%{version}.dist-info +%{python_sitelib}/quimb +%endif + +%changelog diff --git a/quimb-1.7.3.tar.gz b/quimb-1.7.3.tar.gz new file mode 100644 index 0000000..2095509 --- /dev/null +++ b/quimb-1.7.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f021b549a82b225f1beadcdd26e89ce8c9c9c6af21d0a6f45e0b3bb778b3d3a +size 12202705 diff --git a/quimb-1.8.4.tar.gz b/quimb-1.8.4.tar.gz new file mode 100644 index 0000000..0ac4461 --- /dev/null +++ b/quimb-1.8.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b12e3c4741f21435a2c530f8ee963d2d6d935eb6138cf26a2c0db7867e3b3bde +size 11566853