Changelog¶
Release notes for quimb.
v1.14.1 (unreleased)¶
Enhancements:
add
CircuitPEPSSimpleUpdate: a high level quantum circuit simulator that keeps the state as an arbitrary geometry PEPS and applies nearest-neighbor gates with ‘simple update’ style gauging. The geometry is given by a set ofedges, inferred from thegatesor read from apsi0; the accuracy is set bymax_bond; gauges can be periodically re-equilibrated withequilibrate; local expectations are computed with the cluster approximation.add
CircuitPEPOSimpleUpdate: the Heisenberg-picture companion toCircuitPEPSSimpleUpdate. Gates are recorded lazily, then a local observable is built as a bond dimension 1 PEPO on theedgesand evolved backwards through them with simple update gauging and compression (skipping gates outside its reverse lightcone), exposing the evolved operator viaget_evolved_operatorand its|00...0>expectation vialocal_expectation.TensorNetwork.gauge_all_simple: add afuse_multibondsoption for updating gauges while preserving multi-index bonds, supported by explicit bond-index selection intensor_compress_bond.add
LatticeBondMap: helper for consistently assigning lattice bond indices across ordinary and periodic boundaries, use it in PEPS, PEPO, PEPS3D, scalar 2D/3D lattice tensor-network construction, and classical Ising tensor-network construction.eigh_truncated: add ashiftoption for optional diagonal regularization.CircuitMPSLazy: add a MPS-based circuit simulator using lazily evaluated gates and periodic automated compression, performing better compared toCircuitMPSfor long-range gates when usingsrccompression method.Circuit.from_openqasm3_str,Circuit.from_openqasm3_file, andCircuit.from_openqasm3_url: add OpenQASM 3 parsing with custom gates, register broadcasting, and symbolic input tracking.
Bug fixes:
tensor_network_1d_compress_srcandtensor_network_1d_compress_srcmps: callenforce_1d_likelike the other 1D compression methods, fixing compression of tensor networks with long range (site skipping) bonds, e.g. from lazily applied long range gates.enforce_1d_like: fix the identity string insertion for long range bonds when the suppliedsite_tagsorder the two tensors in reverse (e.g. withsweep_reverse=True), which previously wired the identities to the wrong sites.PEPS,PEPO, andPEPS3D: fix periodic construction for length-1 and length-2 cyclic dimensions so normal and periodic bonds remain distinct, including bond-dimension-1 cyclic tensors.TensorNetwork2DVector.compute_norm: ensure we always return a scalar rather than unwrapped tensor network.D2BP.partial_trace_loop_series_expansion: fix the loop series expansion for complex (hermitian) BP messages, which were inserted with the wrong(ket, bra)index ordering inget_cluster_excited(both boundary messages and inner excitation projectors), giving incorrect reduced density matrices for complex states (GH #380).D2BP.normalize_tensors: keep the cached dual tensors in sync when rescaling, so that repeated reduced density matrix computations no longer drift (GH #381).
v1.14.0 (2026-05-10)¶
Breaking Changes
tensor_compress_bond: rename input tensor argstaandtb
Enhancements:
D2BP: support fermionic tensor networks (only computing norm^2 so far, gating/compression need work).tensor_compress_bond: addreduce_optsfor controlling the decomposition options used when reducing each tensor before the main truncating decomposition. For examplereduce_opts={"method": "qr:cholesky"}.add
TensorNetworkGen.select_sitesas a convenience method for selecting a sub network given a list of sites.add
PEPO_product_operatorfor bond-dimension-1 PEPOs given by a product of on-site operators, including cyclic boundary conditions viacyclic=Trueorcyclic=(cyclic_x, cyclic_y).PEPO: accept explicitcyclickwarg in the constructor, to override shape-based boundary-condition inference (required for bond dimension 1 cyclic PEPOs).TensorNetworkGenOperator: add genericapply(dispatching on operator/vector tensor networks),traceandpartial_transposemethods. These now work for arbitrary geometry operator tensor networks (including MPO and PEPO);partial_transposesupports arbitrary hashable site labels.applyalso gains aninplaceoption that propagates to the acting operator rather than the one being acted on.add
TensorNetworkGen.has_siteto test whether an object is a valid site label of a tensor network. The generic implementation checks membership in the site set; 1D, 2D and 3D tensor networks override it with a fast bounds check.add
LocalHam2D.build_pepo_propagator_trotterizedfor a first-order Trotter decomposition ofexpm(x H)as a PEPO. Accepts anorderingargument to control the order in which terms are applied.TensorNetwork.split_simplify: consider all candidate bipartitions for each tensor and accept the one that minimizes the resulting maximum tensor size, rather than the first reduction found.contract_hotrg,coarse_grain_hotrg, their 3D counterparts, andtensor_network_ag_compress_projector: addgauge_powerparameter to control the power applied to the bond gauge weights whencanonize=Truebefore computing the compressed projectors.RegionGraph: addget_maximal_regions,get_minimal_regions, andget_maximal_ancestorshelpers for querying the region hierarchy.
Drawing and schematic updates:
Drawing: add orthographic projection mode alongside the existing axonometric projection via the newprojectionparameter (replacesa/b). Named presets include"orthographic","axonometric", and"isometric".Drawing.translate: new context manager to temporarily offset all draw operations in coordinate space (before projection).Drawing.translate_screen: new context manager to temporarily offset all draw operations in screen space (after projection).Drawing.grid3d: automatically select back-facing planes based on projection so grids always appear behind the scene, use readable tick label orientations for all projections, and place axis labels correctly.
Bug fixes:
CircuitPermMPS.sample: fix output bitstring ordering when the internal MPS qubit order is permuted (GH #327).TensorNetwork.split_tensor: fix handling ofabsorb=None, adding all tensors returned by the split (GH #260).D2BP.gate_: correctly mark touched tensors and rebuild local contraction expressions after applying gates.contract_hotrgand 3D counterpart: fix bug when specifyingstrip_exponentinfinal_contract_opts.
v1.13.0 (2026-03-19)¶
Breaking Changes
ham_hubbard_hardcorefix description and sign convention of hopping strengtht.heisenberg_from_edgesfix sign convention of magnetic field terms.the
quimb.tensorsubmodule structure has been refactored withtn1d,tn2d,tn3d, andtnagsubmodules for better organization. Imports from old locations will still work, but are deprecated. Public classes and functions such asMatrixProductStateare directly accessible from the top levelquimb.tensormodule as before.
Enhancements:
Major updates to splitting/decomposing individual tensors/arrays:
add
array_splitandarray_svalsas the primary array-level entry points for matrix decomposition, consolidating dispatch logic that was previously internal totensor_core.add
register_split_driverandregister_svals_driverdecorators for registering custom matrix decomposition methods witharray_splitandarray_svals.allow
array_splitto handle batches of matrices (for most methods).array_split: automatically detect and forward valid kwargs to underlying decomposition methods.tensor_splitandarray_split: expandabsorboptions significantly beyond"left","both","right",Noneto include"lorthog","rorthog","lfactor","rfactor","lsqrt","rsqrtand"s"for returning partial results (single factors or singular values only). Default changed from"both"to"auto", which uses each method’s natural default.add method
"svd:eig"with main implementationsvd_via_eigfor efficient SVD via hermitian eigen-decomposition, with shortcuts for all absorb modes. This can be faster (especially e.g. on GPU) than the standard SVD, but entails some loss of precision.tensor_split: renamemethodoption"eig"to"svd:eig"to make it clearer that this is an SVD split via eigen-decomposition."eig"remains as a deprecated alias for"svd:eig".add method
"svd:rand"with main implementationsvd_rand_truncatedfor randomized SVD with truncation, with shortcuts for all absorb modes. (This is a new and backend agnostic implementation as opposed to the existing'rsvd'method).add method
"qr:cholesky"qr_via_choleskyfor efficient QR or LQ like decompositions via cholesky decomposition, with shortcuts for all absorb modes. This can be faster than the standard QR (especially on GPU) but entails some loss of precision.tensor_splitandarray_split: add"lsqrt"and"rsqrt"absorb options, update cholesky decomposition tocholesky_regularizedwithshiftas exposed parameter.compute_oblique_projectors: allowmethodkwarg.QR decomposition: add
stabilizekwarg for controlling QR stabilization behavior.decomposition methods: various compatibility improvements for JAX backend.
Other enhancements:
add
Tensor.isfermionicandTensorNetwork.isfermionicmethods.add
Tensor.isblocksparseandTensorNetwork.isblocksparsemethods.add
phase_dualoption toTensorNetwork.conj.rename
tensor_network_1d_compress_zipup_firsttotensor_network_1d_compress_zipup_oversampleand standardiseoversamplearguments.add
tensor_network_1d_compress_srcmps_oversampleandtensor_network_1d_compress_fit_oversamplemethods.add
connected_bipartitionsfor finding all connected bipartitions of a tensor networktn.distribute_exponent: addnew_exponentoption for specifying the new exponent value (default 0.0).tensor_network_1d_compress: correctly handle input networks with non-zero exponents andequalize_norms.add
tensor_network_gate_sandwich_indsfor applying a gate and its conjugate like \(G A G^\dagger\) to a tensor network.tensor_network_ag_gate: addwhich="sandwich"option for applying a gate and its conjugate like \(G A G^\dagger\) to a tensor network, default to this if the supplied tensor network is aTensorNetworkGenOperator.add function
tensor_network_ag_gate_simplefor applying a gate to an arbitrary geometry tensor network vector or operator, using simple update stylegaugesto perform any compression.insert_compressor_between_regionsand upstream CTMRG/HOTRG methods: add explicitcontract_opts,reduce_opts, andcompress_optskeyword arguments for fine-grained control.TensorNetwork2D.contract_boundary,contract_ctmrg,contract_hotrg,coarse_grain_hotrgand their 3D counterparts: addstrip_exponentparameter andequalize_norms="auto"default.TensorNetwork3D.contract_hotrg: use updated projecting/gauging scheme.all compression methods: accept an explicit
compress_optskwarg.tensor_network_ag_compress: allow fine-grained control over split options viacompress_opts.TensorNetworkGen.flatten: add arbitrary geometry flatten method, used in 1D/2D/3D.RegionGraph: various improvements.add
hash_kwargs_to_intutility for hashing keyword arguments to a deterministic integer.
Bug fixes:
fix
isometrize_qrfor complex torch arrays (GH #346).fix
right_canonicalizeto return the right canonicalized tensor network (GH #347)ensure all belief propagation contraction methods correctly propagate the target tensor network’s
.exponent.fix cutoff mode bug in
array_splitdecomposition truncation.fix
tensor_network_1d_compress_zipupequalize_normsexponent accumulation.fix
final_contract_optsinplace handling in boundary contraction methods.fix
squared_op_to_reduced_factorargument handling.fix cholesky decomposition
shiftkwarg forwarding andabsorb="right"direction.fix
sample_hd1bpsub-progress bar display.fix gate tag propagation in
tensor_network_gate_inds.handle
equalize_normscorrectly in TensorNetwork2D.compute_environments (GH #352).
v1.12.1 (2026-01-12)¶
Breaking Changes
bump minimum required python version to 3.11
Bug fixes:
fix
SimpleUpdateGenmixin inheritance order.fix
insert_compressor_between_regionsfor fermionic tensor networks with bond signature +-.
v1.12.0 (2026-01-09)¶
Enhancements:
move the experimental
operatorbuildermodule to the mainquimb.operatormodule.add basic introduction to the operator module - Basics
add new example on tracing tensor network functions Tracing tensor network functions and reusing intermediates
tensor_split: add aninfokwarg, supplying this with an empty dict or with the entry'error'will store the truncation error when usingmethod in {"svd", "svd:eig"}.update infrastructure for TEBD and SimpleUpdate based algorithms.
schematic.Drawing: addgrid,grid3d,bezier,star,crossandzigzagmethods.schematic.Drawing: addrelativeoption toarrowhead,shortenoption totext_betweenandtext_leftandtext_rightoptions toline.add
Drawing.scale_figsizefor automatically setting the absolute figsize based on placed elements.refactor
TEBDGenandSimpleUpdateGenupdate the 2d specific
SimpleUpdateto use the new infrastructure.tn.draw(): show abelian signature if usingsymmrayarrays.tn.draw(): addadjust_limsoptionTNOptimizer: allowautodiff_backend="torch"withjit_fn=Trueto work with array backends with general pytree parameters, e.g.symmrayarrays.tn.gen_gloopsandtn.gen_gloops_sites: addjoin_overlapoption. When building cluster by joining smaller generalized loops, this option controls how many nodes they need to overlap by to be joined together.all message passing routines: add
callbackoptionGBP: allow a message initilization function.
D1BP: allowmessagesto be a callable initialization function.MatrixProductState.gate_nonlocal: addmethod="lazy"option for lazily applying a non-local gate as a sub-MPO without contraction or compression.LocalHamGen.apply_to_arrays: support pytree parameter arrays such assymmray.add
Tensor.get_namespaceandTensorNetwork.get_namespacefor getting a reusable data array namespaceTensorNetwork.isel: usetakewhere possible to better support e.g.torch.vmapacross amplitudes.MatrixProductState.measure, andMatrixProductState.sample: addbackend_randomoption for specifying which backend to use for random number generation when sampling, this can be set for example tojaxto make the whole process jittable, but by default isnumpy, regardless of the actual array backend.
Bug fixes:
fix
insert_compressor_between_regionswheninsert_into is None.tensor network drawing, ensure hyper indices can be specified as
output_inds.fix
MatrixProductState.measurewhen using jax arrays (GH #340).fix
MatrixProductState.measurewhen projecting and keeping a site site (GH #344).
v1.11.2 (2025-07-30)¶
Enhancements:
Update the introduction to tensor contraction docs
Improve efficiency of 1D structured contractions when default
optimizeis used, especially for large bond dimension overlaps.
Bug fixes:
v1.11.1 (2025-06-20)¶
Enhancements:
add
create_bondtotensor_canonize_bondandtensor_compress_bondfor optionally creating a new bond between two tensors if they don’t already share one. Add as a flag toTensorNetwork1DFlat.compressand related functions (GH #294).add
ensure_bonds_existfor ensuring that all bonds in a 1D flat tensor network exist. Use this in thepermute_arraysmethods and optionally in theexpand_bond_dimensionmethod.tn.draw(): permit empty network, and allowcolor=Trueto automatically color all tags.tn.add_tag: add arecord: Optional[dict]kwarg, to allow for easy rewinding of temporary tags without tracking the actual networks.add
qu.plotas a quick wrapper for callingmatplotlib.pyplot.plotwith thequimbstyle.quimb.schematic: addzorder_deltakwarg for fine adjustments to layering of objects in approximately the same position.operatorbuilder: big performance improvements and fixes for building matrix representations including Z2 symmetry. Add defaultsymmetryandsectoroptions that can be overridden at build time. Add lazy (slow, matrix free) ‘apply’ method. Addpauli_decomposetransformation. Add experimental PEPO builder for nearest neighbor operators. Add unit tests.
Bug fixes:
Fix
TensorNetwork2D.compute_plaquette_environmentsformode="zipup"and other boundary contraction methods that use the generic 1D compression algorithms.parse_openqasm2_strallow custom gate names to start with the wordgate(GH #312).MatrixProductState.gate_with_mpo: fix bug to do with inplace argument (GH #313).
v1.11.0 (2025-05-14)¶
Breaking Changes
move belief propagation to
quimb.tensor.belief_propagationcalling
tn.contract()when an non-zero value has been accrued intotn.exponentnow automatically re-absorbs that exponent.binary tensor operations that would previously have errored now will align and broadcast
Enhancements:
Tensor: make binary operations (+, -, *, /, **) automatically align and broadcast indices. This would previously error.MatrixProductState.measure: add aseedkwargbelief propagation, implement DIIS (direct inversion in the iterative subspace)
belief propagation, unify various aspects such as message normalization and distance.
belief propagation, add a
plotmethod.belief propagation, add a
contract_everyoption.HV1BP: vectorize both contraction and message initialization
add
qu.plot_multi_series_zoomfor plotting multiple series with a zoomed inset, useful for various convergence plots such as BPadd
infooption totn.gauge_all_simplefor tracking extra information such as number of iterations and max gauge diffsTensor.gate: addtransposedoptionTensorNetwork.contract: addstrip_exponentoption for return the mantissa and exponent (log10) separately. Compatible withcontract_tags,contract_cumulative,contract_compressedsub modes.tensor_split: addmatrix_svalsoption, ifTrueany returned singular values are put into the diagonal of a matrix (by default,False, they are returned as a vector).add
Tensor.new_ind_pair_diagfor expanding an existing index into a pair of new indices, such that the diagonal of the new tensor on those indices is the old tensor.TNOptimizer: add ‘cautious’ ADAMTensorNetwork.pop_tensor: allowtidor tags to be specified.add an example notebook for converting hyper tensor networks to normal tensor networks, for approximate contraction - Converting a hyper TN for approximate contraction
add progress bar to various
Circuitmethods (PR #288)quimb.operator: fix MPO building for congested operators (GH #296 and GH #301), allow arbitrary dtype (GH #289). Fix building of sparse and matrix representations for non-translationally symmetric operators and operators with trivial (all identity) terms.
Bug fixes:
fix
MatrixProductState.measureforcupybackend arrays (GH #276).fix
linalg.expmdispatch (GH #275)fix ‘dm’ 1d compress method for disconnected subgraphs
fix docs source lookup in
quimb.tensormodulefix raw gate copying in
Circuit(GH #285)
v1.10.0 (2024-12-18)¶
Enhancements:
tensor network fitting: add
method="tree"for when ansatz is a tree -tensor_network_fit_treetensor network fitting: fix
method="als"for complex networkstensor network fitting: allow
method="als"to use a iterative solver suited to much larger tensors, by default a custom conjugate gradient implementation.tensor_network_distanceand fitting: support hyper indices explicitly viaoutput_indskwargadd
tn.make_overlapandtn.overlapfor computing the overlap between two tensor networks, \(\langle O |T \rangle\), with explicit handling of outer indices to address hyper networks. Addoutput_indstotn.normandtn.make_normalso, as well as thesquaredkwarg.replace all
numbabased paralellism (prangeand parallel vectorize) with explicit thread pool based parallelism. Should be more reliable and no need to setNUMBA_NUM_THREADSanymore. Remove env varQUIMB_NUMBA_PAR.Circuit: adddtypeandconvert_eageroptions.dtypespecifies what the computation should be performed in.convert_eagerspecifies whether to apply this (and anyto_backendcalls) as soon as gates are applied (the default for MPS circuit simulation) or just prior to contraction (the default for exact contraction simulation).tn.full_simplify: addcheck_zero(by default set of"auto") option which explicitly checks for zero tensor norms when equalizing norms to avoidlog10(norm)resulting in -inf or nan. Since it creates a data dependency that breaks e.g.jaxtracing, it is optional.schematic.Drawing: addshortenkwarg to line drawing and curve drawing and examples to schematic - manual drawing.TensorNetwork: add.backendand.dtype_nameproperties.
v1.9.0 (2024-11-19)¶
Breaking Changes
renamed
MatrixProductState.partial_traceandMatrixProductState.ptrto MatrixProductState.partial_trace_to_mpo to avoid confusion with otherpartial_tracemethods that usually produce a dense matrix.
Enhancements:
add
Circuit.sample_gate_by_gateand related methodsCircuit.reordered_gates_dfs_clusteredandCircuit.get_qubit_distancesfor sampling a circuit using the ‘gate by gate’ method introduced in https://arxiv.org/abs/2112.08499.add
Circuit.drawfor drawing a very simple circuit schematic.Circuit: by default turn onsimplify_equalize_normsand use agroup_size=10for sampling. This should result in faster and more stable sampling.Circuit: usenumpy.random.default_rngfor random number generation.add
qtn.circ_a2a_randfor generating random all-to-all circuits.expose
qtn.edge_coloringas top level function and allow layers to be returned grouped.add docstring for
tn.contract_compressedand by default pick up important settings from the supplied contraction path optimizer (max_bondandcompress_late)add
Tensor.rand_reducefor randomly removing a tensor index by contracting a random vector into it. One can also supply the value"r"toiselselectors to use this.add
fit-zipupandfit-projectorshorthand methods to the general 1d tensor network compression functionadd
MatrixProductState.compute_local_expectationfor computing many local expectations for a MPS at once, to match the interface for this method elsewhere. These can either be computed via canonicalization (method="canonical"), or via explicit left and right environment contraction (method="envs")specialize
CircuitMPS.local_expectationto make use of the MPS form.add
PEPS.product_statefor constructing a PEPS representing a product state.add
PEPS.vacuumfor constructing a PEPS representing the vacuum state \(|000\ldots0\rangle\).add
PEPS.zerosfor constructing a PEPS whose entries are all zero.tn.gauge_all_simple: improve scheduling and adddampingandtouched_tidsoptions.qtn.SimpleUpdateGen: add gauge difference update checking andtolandequilibratesettings. Update.plot()method. Default to a smallcutoff.add
psi.sample_configuration_clusterfor sampling a tensor network using the simple update or cluster style environment approximation.add the new doc Exploring circuit sampling with various methods
v1.8.4 (2024-07-20)¶
Bug fixes:
fix for
mps_gate_with_mpo_lazy(GH #246).
v1.8.3 (2024-07-10)¶
Enhancements:
support for numpy v2.0 and scipy v1.14
add MPS sampling:
MatrixProductState.sample_configurationandMatrixProductState.sample(generating multiple samples) and use these forCircuitMPS.sampleandCircuitPermMPS.sample.add basic
.plot()method for SimpleUpdate classesadd
edges_1d_chainfor generating 1D chain edgesoperatorbuilder: better coefficient placement for long range MPO building
v1.8.2 (2024-06-12)¶
Enhancements:
TNOptimizercan now accept an arbitrary pytree (nested combination of dicts, lists, tuples, etc. withTensorNetwork,Tensoror rawarray_likeobjects as the leaves) as the target object to optimize.TNOptimizercan now directly optimizeCircuitobjects, 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_paths_loopsfor generating all loops of indices in a TN.add
tn.gen_inds_connectedfor generating all connected sets of indices in a TN.make SVD fallback error catching more generic (PR #238)
fix some windows + numba CI issues.
approx_spectral_functionadd plotting and trackingadd dispatching to various tensor primitives to allow overriding
v1.8.1 (2024-05-06)¶
Enhancements:
CircuitMPSnow 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
CircuitPermMPSadd
MatrixProductState.gate_nonlocalfor 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 (GH #230)add
MatrixProductState.gate_with_mpofor applying an MPO to an MPS, and immediately compressing back to MPS form usingtensor_network_1d_compressadd
MatrixProductState.gate_with_submpofor applying an MPO acting only of a subset of sites to an MPSadd
MatrixProductOperator.from_densefor constructing MPOs from dense matrices, including an only subset of sitesadd
MatrixProductOperator.fill_empty_sitesfor ‘completing’ an MPO which only has tensors on a subset of sites with (by default) identitiesMatrixProductStateandMatrixProductOperator, now support thesiteskwarg in common constructors, enabling the TN to act on a subset of the fullLsites.add
TensorNetwork.drape_bond_betweenfor ‘draping’ an existing bond between two tensors through a thirdTN2D, TN3D and arbitrary geom classical partition function builders (
TN_classical_partition_function_from_edges) now all supportoutputs=kwarg specifying non-marginalized variablesadd simple dense 1-norm belief propagation algorithm
D1BPadd
qtn.enforce_1d_likefor checking whether a tensor network is 1D-like, including automatically adding strings of identities between non-local bonds, expanding applicability oftensor_network_1d_compressadd
MatrixProductState.canonicalizeas (by default non-inplace) version ofcanonize, to follow the pattern of other tensor network methods.canonizeis now an alias forcanonicalize_[note trailing underscore].add
MatrixProductState.left_canonicalizeas (by default non-inplace) version ofleft_canonize, to follow the pattern of other tensor network methods.left_canonizeis now an alias forleft_canonicalize_[note trailing underscore].add
MatrixProductState.right_canonicalizeas (by default non-inplace) version ofright_canonize, to follow the pattern of other tensor network methods.right_canonizeis now an alias forright_canonicalize_[note trailing underscore].
Bug fixes:
Circuit.apply_gate_raw: fix kwarg bug (PR #226)fix for retrieving
opt_einsum.PathInfofor single scalar contraction (GH #231)
v1.8.0 (2024-04-10)¶
Breaking Changes
all singular value renormalization is turned off by default
TensorNetwork.compress_allnow defaults to using some local gauging
Enhancements:
add
quimb.tensor.tn1d.compress.pywith functions for compressing generic 1D tensor networks (with arbitrary local structure) using various methods. The methods are:The ‘direct’ method:
tensor_network_1d_compress_directThe ‘dm’ (density matrix) method:
tensor_network_1d_compress_dmThe ‘zipup’ method:
tensor_network_1d_compress_zipupThe ‘zipup-oversample’ method:
tensor_network_1d_compress_zipup_oversampleThe 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.add
quimb.tensor.tnag.compress.pywith functions for compressing arbitrary geometry tensor networks using various methods. The methods are:The ‘local-early’ method:
tensor_network_ag_compress_local_earlyThe ‘local-late’ method:
tensor_network_ag_compress_local_lateThe ‘projector’ method:
tensor_network_ag_compress_projectorThe ‘superorthogonal’ method:
tensor_network_ag_compress_superorthogonalThe ‘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.support PBC in
tn2d.contract_hotrg,tn2d.contract_ctmrg,tn3d.contract_hotrgand the new functiontn3d.contract_ctmrg.support PBC in
gen_2d_bondsandgen_3d_bonds, withcyclickwarg.support PBC in
TN2D_rand_hidden_loopandTN3D_rand_hidden_loop, withcyclickwarg.support PBC in the various base PEPS and PEPO construction methods.
add
tensor_network_apply_op_opfor applying ‘operator’ TNs to ‘operator’ TNs.tweak
tensor_network_apply_op_vecfor applying ‘operator’ TNs to ‘vector’ or ‘state’ TNs.add
tnvec.gate_with_op_lazymethod for applying ‘operator’ TNs to ‘vector’ or ‘state’ TNs like \(x \rightarrow A x\).add
tnop.gate_upper_with_op_lazymethod for applying ‘operator’ TNs to the upper indices of ‘operator’ TNs like \(B \rightarrow A B\).add
tnop.gate_lower_with_op_lazymethod for applying ‘operator’ TNs to the lower indices of ‘operator’ TNs like \(B \rightarrow B A\).add
tnop.gate_sandwich_with_op_lazymethod 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_symmetricTN2D_rand_symmetricfor generating random symmetric arrays, tensors and 2D tensor networks.
Bug fixes:
fix scipy sparse monkey patch for scipy>=1.13 (GH #222)
fix autoblock bug where connected sectors were not being merged (GH #223)
v1.7.3 (2024-02-08)¶
Enhancements:
qu.randn: support
dist="rademacher".support
distand otherrandnoptions in various TN builders.
Bug fixes:
restore fallback (to
scipy.linalg.svdwith driver=’gesvd’) behavior for truncated SVD with numpy backend.
v1.7.2 (2024-01-30)¶
Enhancements:
add
normalized=Trueoption totensor_network_distancefor computing the normalized distance between tensor networks: \(2 |A - B| / (|A| + |B|)\), which is useful for convergence checks.Tensor.distance_normalizedandTensorNetwork.distance_normalizedadded as aliases.add
TensorNetwork.cut_bondfor cutting a bond index
Bug fixes:
removed import of deprecated
numba.generated_jitdecorator.
v1.7.1 (2024-01-30)¶
Enhancements:
add
TensorNetwork.visualize_tensorsfor visualizing the actual data entries of an entire tensor network.add
ham.build_mpo_propagator_trotterizedfor 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_indandTensor.new_ind: repeat tiling mode and random padding mode.tensor decomposition: make
eigh_truncatedbackend 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_functionfor constructing 2D (triangular) tensor networks representing all-to-all classical ising partition functions.
Bug fixes:
fix bug in
kruas_opwhen operator spanned multiple subsystems (GH #214)fix bug in
qr_stabilizedwhen the diagonal ofRhas significant imaginary parts.fix bug in quantum discord computation when the state was diagonal (GH #217)
v1.7.0 (2023-12-08)¶
Breaking Changes
Circuit: removetarget_sizein 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:
TensorNetwork.draw: use
quimb.schematicfor 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 - manual drawing. Add methods
text_between,wedge,line_offsetand other tweaks for future use by main TN drawing.
upgrade all contraction to use
cotengraas the backendCircuit: allow any gate to be controlled by any number of qubits.Circuit: support for parsingopenqasm2specifications now with custom and nested gate definitions etc.add
is_cyclic_x,is_cyclic_yandis_cyclic_zto 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.tensor.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.
v1.6.0 (2023-09-10)¶
Breaking Changes
Quantum circuit RZZ definition corrected (angle changed by -1/2 to match qiskit).
Enhancements:
add OpenQASM 2.0 parsing support:
Circuit.from_openqasm2_file,Circuit: add RXX, RYY, CRX, CRY, CRZ, toffoli, fredkin, givens gatestruncate TN pretty html reprentation to 100 tensors for performance
contract_compressed, default to ‘virtual-tree’ gaugeadd
TN_rand_treeexperimental.operatorbuilder: fix parallel and heisenberg buildermake 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
v1.5.1 (2023-07-28)¶
Enhancements:
add
MPS_COPY().add ‘density matrix’ and ‘zip-up’ MPO-MPS algorithms.
add
drop_tagsoption totensor_contract()compress_all_simple(), allow cutoff.add structure checking debug methods:
Tensor.check()andTensorNetwork.check().add several direction contraction utility functions:
get_symbol(),inds_to_eq()andarray_contract().
Bug fixes:
Circuit: use stack for more robust parametrized gate generationfix for
gate_with_auto_swap()fori > j.fix bug where calling
tn.norm()would mangle indices.
v1.5.0 (2023-05-03)¶
Enhancements
refactor ‘isometrize’ methods including new “cayley”, “householder” and “torch_householder” methods. See
quimb.tensor.decomp.isometrize().add
compute_reduced_factor()andinsert_compressor_between_regions()methos, for some RG style algorithms.add the
mode="projector"option for 2D tensor network contractionsadd HOTRG style coarse graining and contraction in 2D and 3D. See
coarse_grain_hotrg(),contract_hotrg(),coarse_grain_hotrg(), andcontract_hotrg(),add CTMRG style contraction for 2D tensor networks:
contract_ctmrg()add 2D tensor network ‘corner double line’ (CDL) builders:
TN2D_corner_double_line()update the docs to use the furo theme, myst_nb for notebooks, and several other
sphinxextensions.add the
'adabelief'optimizer toTNOptimizeras well as a quick plotter:plot()add initial 3D plotting methods for tensors networks (
TensorNetwork.draw(dim=3, backend='matplotlib3d')orTensorNetwork.draw(dim=3, backend='plotly')). The newbackend='plotly'can also be used for 2D interactive plots.Update
HTN_from_cnf()to handle more weighted model counting formats.Add
cnf_file_parse()Add
convert_to_2d()Add
convert_to_3d()various optimizations for minimizing computational graph size and construction time.
add
'lu','polar_left'and'polar_right'methods totensor_split().add experimental arbitrary hamilotonian MPO building
TensorNetwork: allow empty constructor (i.e. no tensors representing simply the scalar 1)drop_tags(): allow all tags to be droppedtweaks 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
combine()for unified handling of combining tensor networks potentially with structureadd HTML colored pretty printing of tensor networks for notebooks
add
quimb.experimental.cluster_update.py
Bug fixes:
fix
qr_stabilized()bug for strictly upper triangular R factors.
v1.4.2 (2022-11-28)¶
Enhancements
move from versioneer to to setuptools_scm for versioning
v1.4.1 (2022-11-28)¶
Enhancements
unify much functionality from 1D, 2D and 3D into general arbitrary geometry class
quimb.tensor.tnag.core.TensorNetworkGenrefactor contraction, allowing using cotengra directly
add
visualize()for visualizing the actual data entries of an arbitrarily high dimensional tensoradd
Gateclass for more robust tracking and manipulation of gates in quantumCircuitsimulationtweak TN drawing style and layout
tweak default gauging options of compressed contraction
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 constantsadd
experimentalsubmodule for new sharing featuresregister tensor and tensor network objects with
jaxpytree interface (PR #150)update CI infrastructure
Bug fixes:
v1.4.0 (2022-06-14)¶
Enhancements
Add 2D tensor network support and algorithms
Add 3D tensor network infrastructure
Add arbitrary geometry quantum state infrastructure
Many changes to
TNOptimizerMany changes to TN drawing
Many changes to
CircuitsimulationMany improvements to TN simplification
Make all tag and index operations deterministic
Add
tensor_network_sum(),tensor_network_distance()andfit()Various memory and performance improvements
Various graph generators and TN builders
v1.3.0 (2020-02-18)¶
Enhancements
Added time dependent evolutions to
Evolutionwhen integrating a pure state - see Time-Dependent Evolutions - as well as supportingLinearOperatordefined hamiltonians (PR #40).Allow the
Evolutioncallbackcompute=to optionally access the Hamiltonian (PR #49).Added
quimb.tensor.tensor_core.Tensor.randomize()andquimb.tensor.tensor_core.TensorNetwork.randomize()to randomize tensor and tensor network entries.Automatically squeeze tensor networks when rank-simplifying.
Add
compress_site()for compressing around single sites of MPS etc.Add
MPS_ghz_state()andMPS_w_state()for building bond dimension 2 open boundary MPS reprentations of those states.Various changes in conjunction with autoray to improve the agnostic-ness of tensor network operations with respect to the backend array type.
Add
new_bond()on top ofquimb.tensor.tensor_core.Tensor.new_ind()andquimb.tensor.tensor_core.Tensor.expand_ind()for more graph orientated construction of tensor networks, see Graph Orientated Tensor Network Creation.Add the
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) (PR #50)TN: rename
contraction_complexitytocontraction_width().TN: update
quimb.tensor.tensor_core.TensorNetwork.rank_simplify(), to handle hyper-edges.TN: add
quimb.tensor.tensor_core.TensorNetwork.diagonal_reduce(), to automatically collapse all diagonal tensor axes in a tensor network, introducing hyper edges.TN: add
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
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
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_tensorsandnum_indicesattributes, shownum_indicesin__repr__.TN: various improvements to the pytorch optimizer (PR #34)
TN: add some built-in 1D quantum circuit ansatzes:
circ_ansatz_1D_zigzag(),circ_ansatz_1D_brickwork(), andcirc_ansatz_1D_rand().TN: add parametrized tensors
PTensorand so trainable, TN based quantum circuits – see Tensor Network Training of Quantum Circuits.
Bug fixes:
Fix consistency of
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.0Add environment variable
QUIMB_NUMBA_PARto set whether numba should use automatic parallelization - mainly to fix travis segfaults.Make cache import and initilization of
petsc4pyandslepc4pymore robust.
v1.2.0 (2019-06-06)¶
Enhancements
Added
kraus_op()for general, noisy quantum operationsAdded
projector()for constructing projectors from observablesAdded
measure()for measuring and collapsing quantum statesAdded
cprint()pretty printing states in computational basisAdded
simulate_counts()for simulating computational basis countsTN: Add
quimb.tensor.tensor_core.TensorNetwork.rank_simplify()TN: Add
'split-gate'gate modeTN: Add
TNOptimizerfor tensorflow based optimization of arbitrary, contstrained tensor networks.TN: Add
connect()to conveniently set a shared index for tensorsTN: make many more tensor operations agnostic of the array backend (e.g. numpy, cupy, tensorflow, …)
TN: allow
align_TN_1D()to take an MPO as the first argumentTN: add
build_sparse()TN: add
quimb.tensor.tensor_core.Tensor.unitize()andquimb.tensor.tensor_core.TensorNetwork.unitize()to impose unitary/isometric constraints on tensors specfied using theleft_indskwargMany updates to tensor network quantum circuit (
quimb.tensor.circuit.Circuit) simulation including:49-qubit depth 30 circuit simulation example Quantum Circuits
Add
from quimb.gates import *as shortcut to importX, Z, CNOT, ....Add
U_gate()for parametrized arbitrary single qubit unitary
Bug fixes: