Releases: jcmgray/quimb
v1.8.1
Enhancements:
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
, more docs here: https://quimb.readthedocs.io/en/latest/tensor-circuit-mps.html - add
MatrixProductState.gate_nonlocal
for applying a gate, supplied as a raw matrix, to a non-local and arbitrary number of sites. The kwargcontract="nonlocal"
can be used to force this method, or the new option"auto-mps"
will select this method if the gate is non-local (#230) - add
MatrixProductState.gate_with_mpo
for applying an MPO to an MPS, and immediately compressing back to MPS form usingtensor_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
andMatrixProductOperator
, now support thesites
kwarg in common constructors, enabling the TN to act on a subset of the fullL
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 supportoutputs=
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 oftensor_network_1d_compress
- add
MatrixProductState.canonicalize
as (by default non-inplace) version ofcanonize
, to follow the pattern of other tensor network methods.canonize
is now an alias forcanonicalize_
[note trailing underscore]. - add
MatrixProductState.left_canonicalize
as (by default non-inplace) version ofleft_canonize
, to follow the pattern of other tensor network methods.left_canonize
is now an alias forleft_canonicalize_
[note trailing underscore]. - add
MatrixProductState.right_canonicalize
as (by default non-inplace) version ofright_canonize
, to follow the pattern of other tensor network methods.right_canonize
is now an alias forright_canonicalize_
[note trailing underscore].
Bug fixes:
Circuit.apply_gate_raw
: fix kwarg bug (#226) by @juliendrapeau- fix for retrieving
opt_einsum.PathInfo
for single scalar contraction (#231).
New Contributors
- @juliendrapeau made their first contribution in #226
Full Changelog: v1.8.0...v1.8.1
v1.8.0
Breaking Changes
- all singular value renormalization is turned off by default
TensorNetwork.compress_all
now defaults to using some local gauging
Enhancements:
-
add
quimb.tensor.tensor_1d_compress.py
with functions for compressing generic 1D tensor networks (with arbitrary local structure) using various methods. The methods are:- The 'direct' method:
tensor_network_1d_compress_direct
- The 'dm' (density matrix) method:
tensor_network_1d_compress_dm
- The 'zipup' method:
tensor_network_1d_compress_zipup
- The 'zipup-first' method:
tensor_network_1d_compress_zipup_first
- The 1 and 2 site 'fit' or sweeping method:
tensor_network_1d_compress_fit
- ... and some more niche methods for debugging and testing.
And can be accessed via the unified function
tensor_network_1d_compress
. Boundary contraction in 2D can now utilize any of these methods. - The 'direct' method:
-
add
quimb.tensor.tensor_arbgeom_compress.py
with functions for compressing arbitrary geometry tensor networks using various methods. The methods are:- The 'local-early' method:
tensor_network_ag_compress_local_early
- The 'local-late' method:
tensor_network_ag_compress_local_late
- The 'projector' method:
tensor_network_ag_compress_projector
- The 'superorthogonal' method:
tensor_network_ag_compress_superorthogonal
- The 'l2bp' method:
tensor_network_ag_compress_l2bp
And can be accessed via the unified function
tensor_network_ag_compress
. 1D compression can also fall back to these methods. - The 'local-early' method:
-
support PBC in
tn2d.contract_hotrg
,tn2d.contract_ctmrg
,tn3d.contract_hotrg
and the new functiontn3d.contract_ctmrg
. -
support PBC in
gen_2d_bonds
andgen_3d_bonds
, withcyclic
kwarg. -
support PBC in
TN2D_rand_hidden_loop
andTN3D_rand_hidden_loop
, withcyclic
kwarg. -
support PBC in the various base PEPS and PEPO construction methods.
-
add
tensor_network_apply_op_op
for applying 'operator' TNs to 'operator' TNs. -
tweak
tensor_network_apply_op_vec
for applying 'operator' TNs to 'vector' or 'state' TNs. -
add
tnvec.gate_with_op_lazy
method for applying 'operator' TNs to 'vector' or 'state' TNs like$x \rightarrow A x$ . -
add
tnop.gate_upper_with_op_lazy
method for applying 'operator' TNs to the upper indices of 'operator' TNs like$B \rightarrow A B$ . -
add
tnop.gate_lower_with_op_lazy
method for applying 'operator' TNs to the lower indices of 'operator' TNs like$B \rightarrow B A$ . -
add
tnop.gate_sandwich_with_op_lazy
method for applying 'operator' TNs to the upper and lower indices of 'operator' TNs like$B \rightarrow A B A^\dagger$ . -
unify all TN summing routines into
tensor_network_ag_sum
, which allows summing any two tensor networks with matching site tags and outer indices, replacing specific MPS, MPO, PEPS, PEPO, etc. summing routines. -
add
rand_symmetric_array
,rand_tensor_symmetric
TN2D_rand_symmetric
for generating random symmetric arrays, tensors and 2D tensor networks.
Bug fixes:
- fix scipy sparse monkey patch for scipy>=1.13 (#222)
- fix autoblock bug where connected sectors were not being merged (#223)
Full Changelog: v1.7.3...v1.8.0
v1.7.3
Enhancements:
- qu.randn: support
dist="rademacher"
. - support
dist
and otherrandn
options in various TN builders.
Bug fixes:
- restore fallback (to
scipy.linalg.svd
with driver='gesvd') behavior for truncated SVD with numpy backend.
Full Changelog: v1.7.2...v1.7.3
v1.7.2
Bug fixes:
- removed import of deprecated
numba.generated_jit
decorator.
Enhancements:
- add
normalized=True
option totensor_network_distance
for computing the normalized distance between tensor networks:$2 |A - B| / (|A| + |B|)$ , which is useful for convergence checks.Tensor.distance_normalized
andTensorNetwork.distance_normalized
added as aliases. - add
TensorNetwork.cut_bond
for cutting a bond index
Full Changelog: v1.7.1...v1.7.2
v1.7.1
What's Changed
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 usingTensorNetwork.new
, and building up gates from empty tensor networks usingTensorNetwork.gate_inds_with_tn
. - add more options to
Tensor.expand_ind
andTensor.new_ind
: repeat tiling mode and random padding mode. - tensor decomposition: make
eigh_truncated
backend agnostic. tensor_compress_bond
: addreduced="left"
andreduced="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 ofR
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
New Contributors
Full Changelog: v1.7.0...v1.7.1
v1.7.0
Breaking Changes
Circuit
: removetarget_size
in preparation for all contraction specifications to be encapsulated at the contract level (e.g. withcotengra
)- 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 mainbackend="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 methodstext_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 parsingopenqasm2
specifications now with custom and nested gate definitions etc.- add
is_cyclic_x
,is_cyclic_y
) andis_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
New Contributors
- @king-p3nguin made their first contribution in #209
Full Changelog: v1.6.0...v1.7.0
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
Full Changelog: v1.5.1...v1.6.0
v1.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()
andTensorNetwork.check()
for diagnostics - add
TensorNetwork.isconnected()
,TensorNetwork.istree()
Full Changelog: v1.5.0...v1.5.1
v1.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 <https://pradyunsg.me/furo/>
_ theme,
myst_nb <https://myst-nb.readthedocs.io/en/latest/>
_ for notebooks, and
several othersphinx
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 newbackend='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.
Full Changelog: 1.4.2...v1.5.0