Changelog¶
Release notes for quimb.
v1.16.0 (unreleased)¶
Breaking changes¶
Decomposition and compression defaults
array_splitand low-level rank-revealing decompositions now default tocutoff_mode="rel"instead of"rsum2". 1Dzipupcompression also defaults to"rel".Randomized SVD and batched decompositions reject active cumulative cutoff modes. Use
"abs"or"rel"instead.tensor_network_1d_compresswith an arbitrary-geometrymethodalways returns a 1D network, inserting identities along long-range bonds. To keep the geometry, calltensor_network_ag_compressdirectly, as 2D boundary contraction now does for periodic boundaries, which therefore need an agmethod.
Hilbert spaces and Hubbard models
HilbertSpace: site ordering is now immutable.set_orderingraisesTypeError. Usewith_orderingto create a space with a different ordering.fermi_hubbard_from_edges: default toorder="interleaved", alternating spins at each coordinate to avoid MPO bond dimensions growing with system size, with slightly slower matrix-vector products. Rebuild anything keyed by rank or flat configuration. Useorder="blocked"for the old layout.
Partial traces and local expectations
2D
compute_local_expectation: computetr(rho G)from each term’s reduced density matrix and normalize locally by default (normalized=True). Withreturn_all=True, return plain values, or(expec, trace)pairs withnormalized="return".2D
compute_local_expectationand the new 2D partial trace, expectation, and environment methods requiremax_bond. SupplyNoneexplicitly for no limit, which is not recommended in 2D.2D
partial_traceandlocal_expectationuse the boundary or envs routes. For the previous arbitrary-geometry compressed contraction withoptimize, callTensorNetworkGenVector.partial_traceorTensorNetworkGenVector.local_expectationdirectly.Partial traces derive bra index names by replacing a leading
kwithb, falling back to random uuids on a name collision. This affectspartial_trace_exact,make_reduced_density_matrix, and 3D partial traces. Seeget_bra_inds.Cluster expectations default to
smudge=1e-12andoptimize="auto-hq", matching cluster partial traces.
Enhancements¶
Tensor decompositions¶
Split functions accept
cutoff="auto":1e-10for exact decompositions, disabled for randomized SVD.svd_rand_truncated: support"abs"and"rel"cutoffs on the sketched spectrum, andnoise_dist="normal"or"rademacher"for the random sketch.Batched
"abs"and"rel"cutoffs treat blocks as one spectrum and retain a common bond dimension. Both modes support renormalization, including for batched decompositions.
1D compression and MPS¶
Add a 1D compression guide with method comparisons, benchmarks, and usage examples.
Add successive deterministic compression (
method="sdc"),sdc-oversample, and randomized variantssdcrandsdcr-oversample, supporting fermionic networks, based on https://arxiv.org/abs/2601.19650.direct,dm,zipup,sdc,sdcr,src,srcmps,fit, and their oversampling variants handle long-range bonds directly, supportingsymmrayabelian and fermionic tensors (forsrcmpsandfit, with a suppliedtn_fit).dmuses QR-SVD when a site’s density matrix would exceed its rank bound, reducing layered PEPS norm boundary contraction costs (https://arxiv.org/abs/2406.09769), including for fermionic networks.src,srcmps,fit, and their oversampling variants accept aseedor random generator and match the backend’s device and dtype (autoray v0.10.0 or newer). By default, use the backend’s global random state.tensor_network_1d_compressdefaults tocutoff="auto", choosing the cutoff for each method:0.0forsrcandsrcmps, disabled forsdcrwith its default randomized SVD, and1e-10otherwise.zipup,sdc, andsdcroversampling acceptcutoff_mode_oversample. Zipup also acceptscutoff_oversample="auto". All 1D oversampling methods acceptcompress_opts_finalto configure the final direct sweep separately.fitwithbsz=1now supports fermionic tensor networks, including odd-parity tensors.Add
MatrixProductState.from_product, also used byMPS_product_state, with support for block-sparse single-site vectors.Compression functions accept tag groups in
site_tags; seeparse_site_tag_groups. The 1D, 2D, and arbitrary-geometry wrappers also accept custommethodcallables.
Partial traces, environments, and 2D contraction¶
Add
quimb.tensor.environmentsfor computing many block or plane environments in one sweep on open or periodic geometries.EnvironmentPlansupports"tree","cut"and"cutpair"schedules.gen_exact_environmentsandgen_compressed_environmentsyield environments as they become ready. Choose a 1D, 2D, or arbitrary-geometry compressor withcompress_fn.1D partial traces and local expectations support periodic MPS with
route=None,"canonical", or"envs".MatrixProductState.partial_tracereturns a dense reduced density matrix;compute_partial_tracescomputes many at once. Addlocal_expectationalongsidecompute_local_expectation, with explicit methods for each route.Add
TensorNetwork1D.gen_block_environmentsandcompute_block_environmentsfor exact block environments, andis_cyclicto check for periodic chains.2D partial traces and local expectations support periodic PEPS with
route=None,"boundary", or"envs"and optionsmax_bond,cutoff, andmethod. AddTensorNetwork2DVector.partial_trace,compute_partial_traces, andlocal_expectation, with explicit methods for each route.Add
TensorNetwork2D.gen_block_environmentsandcompute_block_environmentsfor compressed row or column block environments, andcompute_plaquette_environments_via_envsfor plaquettes, including those crossing periodic boundaries.The 2D
"envs"route supportssecond_denseto control exact contraction of the remaining strip, by default only for strips one plane wide, alongsideautogroup,first_contract, customlayer_tags, fixedplaquette_sizes, andcallback_rhosto save reduced density matrices as they finish.max_separation=0.5enables half-layer compression, including with a single periodic environment.Add the 2D
"cluster_boundary"route:partial_trace_cluster_boundary,compute_partial_traces_cluster_boundary, andcompute_local_expectation_cluster_boundary. Control cluster size withmax_distance, including across periodic boundaries or over a whole periodic direction, optionally insert simple-updategauges, and use 1D boundary compression methods.max_separationcontrols uncompressed lines around kept sites, with0.5enabling half-layer compression even with only one boundary.contract_boundarywitharoundnow respectsmax_separationon each side of the target region.Add
compute_partial_traces_exactandcompute_partial_traces_clusterfor computing many reduced density matrices at once.Exact and cluster partial traces now accept
get="tn"for an uncontracted network.D2BP.partial_tracenow acceptsnormalized="return"for(rho, trace)without normalization.2D
contract_boundarywithmethod="full-bond"acceptscompress_optsto configure the similarity decomposition, orsimilarity_methodas a shortcut.Norm, overlap, and reduced density matrix constructors, and 2D norm, normalization, partial trace, and expectation methods accept
layer_tags=Trueor1for the default ket and bra tags andFalseor0to disable them. Methods operating on an existing network reject these boolean and integer options with a clear error. 2Dnormalizenow honors custom layer tags.
Gates and circuits¶
Add
daggerandtransposeoptions to tensor-network gating methods, includingtensor_network_gate_inds,tensor_network_gate_sandwich_inds,tensor_network_ag_gate,tensor_network_ag_gate_simple, andgate_sandwich_with_op_lazy. These apply \(G^\dagger\) or \(G^T\) instead of \(G\).MatrixProductState.gate_nonlocalalso acceptstranspose.Add
MatrixProductOperator.gate_sandwich_with_auto_swapfor two-site gate sandwiches that preserve canonical form, including long-range gates, with optional exponent stripping.CircuitPEPOSimpleUpdate: adddtype,to_backend, andconvert_eageroptions, matchingCircuitPEPSSimpleUpdate.
Time evolution and run management¶
Add
LocalHamGen.get_trotter_gatesfor first-, second-, and fourth-order Trotter approximations over multiple steps, inherited by 1D, 2D, and 3D Hamiltonians.TrotterGateobjects unpack asU, where. Consecutive uses of the same commuting layer are fused by default.trotter_schedulereturns the product formula alone.build_mpo_propagator_trotterizedandbuild_pepo_propagator_trotterizedacceptorder(default 1). The 1D method also gainsordering, matching the 2D method.TEBD and simple-update classes accept
logdirandlog_everyto writeprogress.json. Useplot_progress_logwithwatch=Trueto monitor a running job, orload_progress_logfor raw data.These classes accept
checkpoint_everyto savecheckpoint.pklinlogdir, including a final checkpoint on normal or graceful completion. Continue withresume=Trueor load withfrom_checkpoint; resumed runs restore state and evolution options, so omitpsi0andham.log_everyandcheckpoint_everyaccept sweep counts or durations such as"10mins"; seeparse_time_spec.A
STOPfile inlogdiror the first Ctrl-C duringevolvestops the run after the current sweep. The file is removed once seen; a second interrupt stops immediately. Usegraceful_interrupt=Falsefor the previous interrupt behavior.
Belief propagation and loop expansions¶
Support fermionic BP projector compression with
method="projector", canonize="bp"and fermionic gates withD2BP.gate_.All BP classes accept
diisanddampingin both__init__andrun. Values passed torunbecome the new defaults.D1BP,D2BP,L1BP,L2BP, andTensorNetwork.gauge_all_simpleacceptsweep_order, with an efficient alternating schedule for trees. SeeSweepSchedulerfor other options.Add
gen_gloops_edge_induced(tn.gen_gloops_edge_induced), yieldingNetworkPatchobjects that distinguish loops using different bonds on the same tensors.Infinite 2D generalized-loop expectations accept
max_sizeandnum_joins. Reuse theirinfocache across loop settings while the state, gauges, and operators remain unchanged.
Network construction¶
TN_from_strings: addjoin_prefer="short"or"long"to favor smaller or larger loops, andjoin_avoid_loop_length(default 2) to avoid loops up to a given length. Set it to 0 to disable loop avoidance.join_preferdoes not supportjoin="all".Add hidden-cactus networks
TN2D_rand_hidden_cactus,TN3D_rand_hidden_cactus, andTN_rand_hidden_cactusto extend hidden correlations while preserving lattice bond dimensions and low exact contraction cost. Also available throughTN_from_strings(..., join_trees=True).Add
TN_rand_hidden_loop, the arbitrary-graph counterpart ofTN2D_rand_hidden_loop.Add
TensorNetwork.insert_projectors_between_regionsto insert precomputed projector arrays between regions.TN_matching: addedgesto choose which sites to join, for example a plain chain ignoring long-range bonds.
Hilbert spaces and utilities¶
HilbertSpace: supportU1U1sectors with any site ordering and aspeciesargument selecting each site’s conserved charge. Accept sector forms{species: filling},(ka, kb), and((na, ka), (nb, kb)).order="blocked"groups species;"interleaved"alternates them at each position.Add
distance_from_overlapsfor normalized distances and infidelities from three precomputed overlaps.save_to_disk: addatomicto prevent partially written targets.
Deprecations¶
Tensor.gate: renametransposedtotranspose. The old name raisesFutureWarning.2D boundary contraction, environment, and norm methods: rename
modetomethod, withFutureWarningfor the old name. Withmode="full-bond", amethodsupplied as well is taken assimilarity_method.MatrixProductState.compute_local_expectation: renamemethodtoroute, withFutureWarningfor the old name.Rename
MatrixProductState.partial_trace_to_dense_canonicaltopartial_trace_canonical. The old name still works but raises a warning.TN_from_strings: deprecatejoin_avoid_self_loopsin favor ofjoin_avoid_loop_length.
Bug fixes¶
Sparse matrices¶
csr_matrix @ vector: fix wrong results for tall matrices and segfaults for wide matrices on the parallel path, used fornnz > 50000oncequimbis imported (GH #432).
Operators and time evolution¶
SpinHam1D.build_sparse: include the last term withcyclic=True(GH #419).ikron: raiseValueErrorfor out-of-range or repeated indices, which previously placed fewer operators than supplied without an error.build_matrix_ikron: fix incorrect matrices with non-identity ordering or non-integer site labels.HilbertSpace: prevent incorrect rank-to-configuration mappings after reordering, including invalid configurations for mixed dimensions. Ordering is now immutable, as described above.TEBD: fixorder=4to achieve fourth-order accuracy. Correct Suzuki weights include backward evolution during part of each step. Also acceptorder=1.build_mpo_propagator_trotterized: fix cyclic wrapping terms that are not symmetric under a site swap.FullUpdate: reuse the cached plaquette map incompute_energy.
Decompositions and compression¶
compute_oblique_projectors: avoidinfornanprojectors for rank-deficient environments withcutoff=0.0. The same fix applies to shared diagonal division helpers andD2BP.gauge_insertwithreturn_gauges="inverse".safe_inverse: fixTypeErrorin projector boundary contractions with block-sparse backends such assymmray.tensor_split: fixmethod="svd:rand"for complex and single-precision arrays, preserving dtype and device, andmethod="svd:eig"with nonzerocutofffor single precision and Numba.Oblique projector compression, including
L2BP.compress, CTMRG, and HOTRG: fixshape-mismatcherrors withsymmrayblock-sparse arrays.3D boundary contraction: remove temporary site tags from replaced tensors, including those shared with cached environments.
1D
fitwithmax_iterations=1: build any initial guess atmax_bondrather than padding a smaller one, and fix aTypeErrorwhen onlycutoffis given.1D
srcmps: conjugate the sampling MPS, so a supplied guess helps for complex arrays, and odd-parity fermionic networks work.
Fermionic tensors¶
1D compression: fix
fitfor fermionic networks, anddmfor mixed bond orientations and truncated odd-parity norm networks.Projector compression (
method="projector"): fix zero projectors for odd-parity fermionic norm networks with everycanonizeoption.D2BP.compressandD2BP.gauge_symmetric: preserve positive messages and full-rank identity matrices for fermionic networks.Tensor.conj: addoutput_indsto select output legs for fermionic conjugation phases. Fix conjugation phases for subnetworks and paired and unpaired odd-parity dummy modes inTensorNetwork.conjandTensor.conj.
Belief propagation and overlaps¶
D1BP.contract_loop_series_expansionandD2BP.contract_loop_series_expansion: include all distinct loops in each region and correct suppression factors. Multi-excitation corrections raiseRuntimeErrorif they fail to converge.D2BP.normalize_tensorsand single-siteD2BP.gate_: keep contractions consistent after updates. Reject distinct supplied networks, and fix message ordering for complex two-site gates.D2BP.gauge_temp: restore gauges when its body raises. Fix relativesmudgescaling for unsorted symmetry-block spectra.tensor_network_distance: remove incorrect dependence of infidelity on relative phase.
Partial traces and general tensor operations¶
partial_trace_exact: fixAttributeErrorwithget="tensor"andnormalized=True.Exact, cluster, and arbitrary-geometry partial traces and local expectations accept a single site as
whereinstead of raisingTypeError.local_expectation_cluster: supportmax_bondon MPS.2D
compute_local_expectation: accept reversed two-site terms withoutKeyErrorin the boundary route.compute_local_expectation_exactandcompute_local_expectation_cluster: correctly sum normalized expectations withnormalized="return"andreturn_all=False. Methods that compute terms individually also complete their progress bars.MPS_product_state: fixTypeErrorfor backends requiring a single shape tuple when reshaping single-site vectors.TensorNetwork.tids_are_connected: make results independent of tensor order.
v1.15.0 (2026-08-10)¶
Breaking changes (1.15.0)¶
Circuits
Circuit.uni: return the non-transposed unitary, socirc.uni.to_dense()givesUacting asU @ psi. Usecirc.get_uni(transposed=True)for the old convention.Non-exact circuit simulators now inherit
CircuitBaserather thanCircuit. Useisinstance(circ, CircuitBase)for any circuit type. Exact-only methods such asget_uni,get_psi_simplified, andsample_gate_by_gateare no longer available on these simulators.MPS circuit methods operate directly on the current, possibly compressed state and no longer accept
simplify_*options. Unsupported representation-specific methods raiseNotImplementedErrorconsistently.
Gauging and loop expansions
TensorNetwork.gauge_all_simple: arguments aftermax_iterationsandtol, includingsmudge,power, anddamping, are keyword-only.Simple-update gauging:
smudgeandgauge_smudgeare relative to the largest gauge value. Results change for unnormalized gauges, but remain unchanged whenmax(g) == 1.Automatic generalized-loop sizing (
max_size=Noneintn.gen_gloops, orgloops=Nonein loop expansions) covers every target tensor or site that belongs to a loop. Targets outside loops are ignored, withUserWarningfor explicit targets or trees with no loops. Loops larger than the resolved size are excluded. Usemax_size="min"orgloops="min"for the old behavior.
Enhancements (1.15.0)¶
Circuit simulators and OpenQASM¶
Add
CircuitPEPSSimpleUpdatefor arbitrary-geometry PEPS circuits with nearest-neighbor simple-update gates and cluster expectations. Define geometry withedgesor infer it fromgatesorpsi0; control accuracy withmax_bondand gauge equilibration withequilibrate.Add
CircuitPEPOSimpleUpdate, a Heisenberg-picture simulator using backward PEPO evolution with simple-update compression and reverse-light-cone filtering. Useget_evolved_operatorfor the evolved observable orlocal_expectationfor its|00...0>expectation.Add
CircuitBase, the shared base for all circuit simulators. Itsfrom_*constructors accept representation-specific options.Add
CircuitMPSLazyfor deferred gate evaluation and periodic compression, which can be more efficient for long-range gates withsrccompression. MPS simulators also gaincompute_marginalandsample_chaotic.Add OpenQASM 3 parsing through
from_openqasm3_str,from_openqasm3_file, andfrom_openqasm3_url, supporting custom gates, register broadcasting, and symbolic input tracking.CircuitDense: support controlled gates throughcontrols=without building the full dense operator.
Infinite 2D tensor networks¶
Add
quimb.tensor.tn2dinffor infinite-PEPS ground states:GeometryInfinite2Ddefines the unit cell,PEPSInfinite2Dstores the state,LocalHamInfinite2Ddefines the Hamiltonian, andSimpleUpdateInfinite2Dperforms imaginary-time simple update. Support dense, Abelian-symmetric, and fermionicsymmraybackends, with cluster (max_distance) or generalized-loop (gloops) expectations. Hamiltonians can include longer-range terms than the state geometry.Add
GeometryInfinite2D.squarefor square-lattice unit cells. Set neighbor range withcouplings(neighbor shells or displacement vectors) orradius.
Gates, gauges, and lattice bonds¶
tensor_network_ag_gate_simple: support long-range gates between sites without a direct bond throughtensor_network_ag_gate_simple_long_range.TensorNetwork.gauge_all_simple: addfuse_multibondsto preserve multi-index bonds during gauging.tensor_compress_bondsupports explicit bond-index selection;SimpleUpdateGenpreserves multi-index bonds by default.Add
tensor_gauge_simple_bondto gauge a single bond using a sharedgaugesdictionary.tensor_canonize_bond: addswap_indsto move indices between tensors during canonization andbond_indfor explicit bond selection.Add
LatticeBondMapfor consistent lattice bond indices across open and periodic boundaries.LocalHamGen.get_auto_ordering: return commuting layers withgroup=Trueforsort,random, andNone.order="random-ungrouped"groups shuffled terms while preserving their order.
Belief propagation: gauging and loop expansions¶
Add
gauge_d2bp,TensorNetwork.gauge_all_belief_propagation, andD2BP.gauge_symmetricfor symmetric gauging with dense 2-norm belief propagation.D2BP: addpower, relativesmudgeconditioning, andconverge_d2bp. Support BP messages as projector environments, includingcanonize="bp"intensor_network_ag_compress_projector.TensorNetworkGenVector.norm_gloop_expand: add aninfocache, shared withcompute_local_expectation_gloop_expandfornormalized="global". Suppliedgaugesare copied rather than modified.combine_local_contractionsgainspower.D1BP.contract_gloop_expand: include singleton regions and optionally remove dangling tensors without modifying the target network.
Norms, decompositions, and backend conversion¶
TensorNetwork.norm,norm_gloop_expand, andnormalize_simpleacceptstrip_exponentto return the norm or normalization factor as separate mantissa and base-10 exponent values.eigh_truncated: addshiftfor optional diagonal regularization.Add
Tensor.toandTensorNetwork.toto change backend, dtype, or device (autoray v0.9.0 or newer).trace_distance: speed up Hermitian trace distances using eigenvalues. Useisherm=Falsefor the previous singular-value calculation.
Bug fixes (1.15.0)¶
Circuits¶
CircuitDense: fixValueErrorinpsi,partial_trace, andlocal_expectation.get_uniraises the same clearValueErrorasunibecause the dense state cannot provide the unitary.CircuitPermMPS: returnamplitude,to_dense, andlocal_expectationresults in logical qubit order after lazy permutations.CircuitPermMPSandCircuitMPSLazy: preserve subclass attributes incopy()(GH #387).CircuitMPSLazy: apply pending gates and configured compression before state accessors run. Results no longer depend on accessor order (GH #387).CircuitMPSand subclasses: raiseNotImplementedErrorfor unsupportedschrodinger_contractinstead of an internalIndexError(GH #387).Circuit.get_rdm_lightcone_simplified: preventpartial_traceandlocal_expectationfrom returning results cached before later gates were applied (GH #398).
Belief propagation: messages and loop corrections¶
TensorNetwork.gen_gloops: fix automatic sizing and joins for dangling target tensors. Addallow_dangling, on by default for local expectations and partial traces."alldangle"and"anydangle"remain aliases.D1BP.contract_loop_series_expansionandHD1BP.contract_gloop_expand: generate loops withgloops=Noneinstead of raisingTypeError.D2BP.partial_trace_loop_series_expansion: fix incorrect reduced density matrices for complex states (GH #380).D2BP.normalize_tensors: prevent repeated reduced-density-matrix calculations from drifting after rescaling (GH #381).D2BP.compress: make later message updates use the compressed tensor data after in-place compression.
Compression, lattice boundaries, and norms¶
tensor_network_1d_compress_srcandtensor_network_1d_compress_srcmps: fix compression of networks with long-range bonds that skip sites.enforce_1d_like: connect long-range bonds correctly whensite_tagsreverse their site order, includingsweep_reverse=True.PEPS,PEPO, andPEPS3D: keep open and periodic bonds distinct for cyclic dimensions of length 1 or 2, including bond dimension 1.TensorNetwork3D.contract_peps_sweep: preserve norm exponents and support separate mantissa/exponent returns withstrip_exponent=True.TN_from_stringsand random hidden-loop networks: fix normalization when the tensor-network exponent is nonzero.TensorNetwork2DVector.compute_norm: always return a scalar.TensorNetworkGenVector.norm_gloop_expand: include the tensor-network exponent.TensorNetwork.isel: support slices.
Internal (1.15.0)¶
Convert
quimb.tensor.circuitfrom a module to a package, preserving public imports and existing pickles.
Documentation (1.15.0)¶
Sphinx AutoAPI documents each object only where it is defined. Support short suffix links such as
Tensor.
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
CircuitBase.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:
CircuitBase.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:
CircuitBase.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_core.tensor_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
decomp.isometrize().add
TensorNetwork.compute_reduced_factor()andTensorNetwork.insert_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
TensorNetwork2D.coarse_grain_hotrg(),TensorNetwork2D.contract_hotrg(),TensorNetwork3D.coarse_grain_hotrg(), andTensorNetwork3D.contract_hotrg(),add CTMRG style contraction for 2D tensor networks:
TensorNetwork2D.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:TNOptimizer.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)TensorNetwork.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
TensorNetwork.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
TensorNetworkGenrefactor contraction, allowing using cotengra directly
add
Tensor.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
TensorNetwork.compute_hierarchical_grouping()improve
tensor_core.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()andTensorNetwork.fit()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
Tensor.randomize()andTensorNetwork.randomize()to randomize tensor and tensor network entries.Automatically squeeze tensor networks when rank-simplifying.
Add
TensorNetwork1DFlat.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
tensor_core.new_bond()on top ofTensor.new_ind()andTensor.expand_ind()for more graph orientated construction of tensor networks, see Graph Orientated Tensor Network Creation.Add the
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) (PR #50)TN: rename
contraction_complexitytoTensorNetwork.contraction_width().TN: update
TensorNetwork.rank_simplify(), to handle hyper-edges.TN: add
TensorNetwork.diagonal_reduce(), to automatically collapse all diagonal tensor axes in a tensor network, introducing hyper edges.TN: add
TensorNetwork.antidiag_gauge(), to automatically flip all anti-diagonal tensor axes in a tensor network allowing subsequent diagonal reduction.TN: add
TensorNetwork.column_reduce(), to automatically identify tensor axes with a single non-zero column, allowing the corresponding index to be cut.TN: add
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
calc.measure()for measuring and collapsing quantum statesAdded
cprint()pretty printing states in computational basisAdded
calc.simulate_counts()for simulating computational basis countsTN: Add
TensorNetwork.rank_simplify()TN: Add
TensorNetwork.isel()TN: Add
TensorNetwork.cut_iter()TN: Add
'split-gate'gate modeTN: Add
TNOptimizerfor tensorflow based optimization of arbitrary, contstrained tensor networks.TN: Add
Dense1D.rand()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
SpinHam1D.build_sparse()TN: add
Tensor.unitize()andTensorNetwork.unitize()to impose unitary/isometric constraints on tensors specfied using theleft_indskwargMany updates to tensor network quantum 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: