quimb.tensor.tensor_approx_spectral

Approximating spectral functions with tensor networks.

Functions

MPO_rand(L, bond_dim[, phys_dim, normalize, cyclic, ...])

Generate a random matrix product state.

MPO_zeros_like(mpo, **mpo_opts)

Return a zeros matrix product operator with the same physical index and

construct_lanczos_tridiag_MPO(A, K[, v0, ...])

Module Contents

quimb.tensor.tensor_approx_spectral.MPO_rand(L, bond_dim, phys_dim=2, normalize=True, cyclic=False, herm=False, dtype='float64', dist='normal', loc=0.0, scale=1.0, **mpo_opts)[source]

Generate a random matrix product state.

Parameters:
  • L (int) – The number of sites.

  • bond_dim (int) – The bond dimension.

  • phys_dim (int, optional) – The physical (site) dimensions, defaults to 2.

  • normalize (bool, optional) – Whether to normalize the operator such that trace(A.H @ A) == 1.

  • cyclic (bool, optional) – Generate a MPO with periodic boundary conditions or not, default is open boundary conditions.

  • dtype ({float, complex} or numpy dtype, optional) – Data type of the tensor network.

  • dist ({'normal', 'uniform', 'rademacher', 'exp'}, optional) – Type of random number to generate, defaults to ‘normal’.

  • loc (float, optional) – An additive offset to add to the random numbers.

  • scale (float, optional) – A multiplicative factor to scale the random numbers by.

  • herm (bool, optional) – Whether to make the matrix hermitian (or symmetric if real) or not.

  • mpo_opts – Supplied to MatrixProductOperator.

quimb.tensor.tensor_approx_spectral.MPO_zeros_like(mpo, **mpo_opts)[source]

Return a zeros matrix product operator with the same physical index and inds/tags as mpo.

Parameters:

mpo (MatrixProductOperator) – The MPO to copy the shape of.

Return type:

MatrixProductOperator

quimb.tensor.tensor_approx_spectral.construct_lanczos_tridiag_MPO(A, K, v0=None, initial_bond_dim=None, beta_tol=1e-06, max_bond=None, seed=False, v0_opts=None, k_min=10)[source]