Releases: jcmgray/quimb
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
1.4.2
1.4.1
Enhancements
- unify much functionality from 1D, 2D and 3D into general arbitrary geometry
class :class:quimb.tensor.tensor_arbgeom.TensorNetworkGen
- refactor contraction, allowing using cotengra directly
- add :meth:
~quimb.tensor.tensor_core.Tensor.visualize
for visualizing the
actual data entries of an arbitrarily high dimensional tensor - add :class:
~quimb.tensor.circuit.Gate
class for more robust tracking and
manipulation of gates in quantum :class:~quimb.tensor.circuit.Circuit
simulation - tweak TN drawing style and layout
- tweak default gauging options of compressed contraction
- add :meth:
~quimb.tensor.tensor_core.TensorNetwork.compute_hierarchical_grouping
- add :meth:
~quimb.tensor.tensor_core.Tensor.as_network
- add :meth:
~quimb.tensor.tensor_core.TensorNetwork.inds_size
- add :meth:
~quimb.tensor.tensor_core.TensorNetwork.get_hyperinds
- add :meth:
~quimb.tensor.tensor_core.TensorNetwork.outer_size
- improve :meth:
~quimb.tensor.tensor_core.TensorNetwork.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
(:pull:150
) - update CI infrastructure
Bug fixes:
- fix force atlas 2 and
weight_attr
bug (:issue:126
) - allow unpickling of
PTensor
objects (:issue:128
, :pull:131
)
1.4.0
Enhancements
- Add 2D tensor network support and algorithms
- Add 3D tensor network infrastructure
- Add arbitrary geometry quantum state infrastructure
- Many changes to :class:
TNOptimizer
- Many changes to TN drawing
- Many changes to :class:
Circuit
simulation - Many improvements to TN simplification
- Make all tag and index operations deterministic
- Add :func:
~quimb.tensor.tensor_core.tensor_network_sum
,
:func:~quimb.tensor.tensor_core.tensor_network_distance
and
:meth:~quimb.tensor.tensor_core.TensorNetwork.fit
- Various memory and performance improvements
- Various graph generators and TN builders
1.3.0
Enhancements
- Added time dependent evolutions to :class:
~quimb.evo.Evolution
when integrating a pure state - see :ref:time-dependent-evolution
- as well as supportingLinearOperator
defined hamiltonians (:pull:40
). - Allow the :class:
~quimb.evo.Evolution
callbackcompute=
to optionally access the Hamiltonian (:pull:49
). - Added :meth:
quimb.tensor.tensor_core.Tensor.randomize
and :meth:quimb.tensor.tensor_core.TensorNetwork.randomize
to randomize tensor and tensor network entries. - Automatically squeeze tensor networks when rank-simplifying.
- Add :meth:
~quimb.tensor.tensor_1d.TensorNetwork1DFlat.compress_site
for compressing around single sites of MPS etc. - Add :func:
~quimb.tensor.tensor_gen.MPS_ghz_state
and :func:~quimb.tensor.tensor_gen.MPS_w_state
for building bond dimension 2 open boundary MPS reprentations of those states. - Various changes in conjunction with
autoray <https://github.com/jcmgray/autoray>
_ to improve the agnostic-ness of tensor network operations with respect to the backend array type. - Add :func:
~quimb.tensor.tensor_core.new_bond
on top of :meth:quimb.tensor.tensor_core.Tensor.new_ind
and :meth:quimb.tensor.tensor_core.Tensor.expand_ind
for more graph orientated construction of tensor networks, see :ref:tn-creation-graph-style
. - Add the :func:
~quimb.gen.operators.fsim
gate. - Make the parallel number generation functions use new
numpy 1.17+
functionality rather thanrandomgen
(which can still be used as the underlying bit generator) (:pull:50
) - TN: rename
contraction_complexity
to :meth:~quimb.tensor.tensor_core.TensorNetwork.contraction_width
. - TN: update :meth:
quimb.tensor.tensor_core.TensorNetwork.rank_simplify
, to handle hyper-edges. - TN: add :meth:
quimb.tensor.tensor_core.TensorNetwork.diagonal_reduce
, to automatically collapse all diagonal tensor axes in a tensor network, introducing hyper edges. - TN: add :meth:
quimb.tensor.tensor_core.TensorNetwork.antidiag_gauge
, to automatically flip all anti-diagonal tensor axes in a tensor network allowing subsequent diagonal reduction. - TN: add :meth:
quimb.tensor.tensor_core.TensorNetwork.column_reduce
, to automatically identify tensor axes with a single non-zero column, allowing the corresponding index to be cut. - TN: add :meth:
quimb.tensor.tensor_core.TensorNetwork.full_simplify
, to iteratively perform all the above simplifications in a specfied order until nothing is left to be done. - TN: add
num_tensors
andnum_indices
attributes, shownum_indices
in__repr__
. - TN: various improvements to the pytorch optimizer (:pull:
34
) - TN: add some built-in 1D quantum circuit ansatzes:
:func:~quimb.tensor.circuit_gen.circ_ansatz_1D_zigzag
,
:func:~quimb.tensor.circuit_gen.circ_ansatz_1D_brickwork
, and
:func:~quimb.tensor.circuit_gen.circ_ansatz_1D_rand
. - TN: add parametrized tensors :class:
~quimb.tensor.tensor_core.PTensor
and so trainable, TN based quantum circuits -- see :ref:example-tn-training-circuits
.
Bug fixes:
- Fix consistency of :func:
~quimb.calc.fidelity
by making the unsquared version the default for the case when either state is pure, and always return a real number. - Fix a bug in the 2D system example for when
j != 1.0
- Add environment variable
QUIMB_NUMBA_PAR
to set whether numba should use automatic parallelization - mainly to fix travis segfaults. - Make cache import and initilization of
petsc4py
andslepc4py
more robust.
quimb-1.2.0
Enhancements
-
Added
kraus_op
for general, noisy quantum operations -
Added
projector
for constructing projectors from observables -
Added
measure
for measuring and collapsing quantum states -
Added
cprint
pretty printing states in computational basis -
Added
simulate_counts
for simulating computational basis counts -
TN: Add
TensorNetwork.rank_simplify
-
TN: Add
TensorNetwork.isel
-
TN: Add
TensorNetwork.cut_iter
-
TN: Add
'split-gate'
gate mode -
TN: Add
optimize_tensorflow.TNOptimizer
for tensorflow based optimization
of arbitrary, contstrained tensor networks. -
TN: Add
Dense1D.rand
-
TN: Add
tensor_core.connect
to conveniently set a shared index for tensors -
TN: make many more tensor operations agnostic of the array backend (e.g. numpy, cupy,
tensorflow, ...) -
TN: allow
tensor_1d.align_TN_1D
to take an MPO as the first argument -
TN: add
SpinHam.build_sparse
-
TN: add
Tensor.unitize
andTensorNetwork.unitize
to impose unitary/isometric constraints on tensors specified using theleft_inds
kwarg -
Many updates to tensor network quantum circuit simulation including:
CircuitMPS
CircuitDense
- 49-qubit depth 30 circuit simulation example https://quimb.readthedocs.io/en/latest/examples/ex_quantum_circuit.html
-
Add
from quimb.gates import *
as shortcut to importX, Z, CNOT, ...
. -
Add
U_gate
for parametrized arbitrary single qubit unitary
Bug fixes: