quimb.experimental.belief_propagation.mps1bp

Classes

MPS1BP

Matrix product state 1-norm lazy belief propagation.

Module Contents

class quimb.experimental.belief_propagation.mps1bp.MPS1BP(tn, max_bond, layer_tags, site_tags=None, *, cutoff=0.0, method='srcmps', fit_messages=True, compress_opts=None, damping=0.0, update='sequential', normalize='L2', distance='L2', local_convergence=True, optimize='auto-hq', **kwargs)

Bases: quimb.tensor.belief_propagation.bp_common.BeliefPropagationCommon

Matrix product state 1-norm lazy belief propagation.

Parameters:
  • tn (TensorNetwork) – The tensor network to perform belief propagation on. It should have a ‘graph + 1’ structure, i.e. some geometry (given by site_tags) repeated in layers (given by layer_tags).

  • max_bond (int) – The maximum bond dimension to use when compressing the message update tensor network.

  • layer_tags (sequence[str, ...]) – The tags which identify the layers of the tensor network. Each tensor should have exactly one of these tags.

  • site_tags (sequence[str, ...], optional) – The tags which identify the sites of the tensor network. If None, these are assumed to be default tn.site_tags.

  • cutoff (float, optional) – The cutoff to use when compressing the message update tensor network. Default is 0.0.

  • method (str, optional) – The method to use when compressing the message update tensor network. See qtn.tensor_network_1d_compress for options.

  • fit_messages (bool, optional) – Whether to use the current message as a fit target when using ‘fit’ or ‘srcmps’ compression methods. Default is True.

  • compress_opts (dict, optional) – Additional options to pass to qtn.tensor_network_1d_compress.

  • optimize (str, optional) – The optimization strategy to use when contracting tensor networks.

  • kwargs – Additional keyword arguments to pass to the base BeliefPropagationCommon class.

local_convergence = True
touched
layer_tags
max_bond
compress_opts
fit_messages = True
backend = 'numpy'
optimize = 'auto-hq'
messages
get_message_tn(a, b) quimb.tensor.TensorNetwork

Get the (uncompressed) tensor network describing the current message from site a to site b.

compute_message(a, b) quimb.tensor.TensorNetwork

Compute the (compressed) tensor network message from site a to site b.

iterate(tol=5e-06)

Perform one round of message passing.

contract(strip_exponent=False, check_zero=True, **kwargs)

Contract the target tensor network, via the belief propagation approximation, using the current messages.

Parameters:
  • strip_exponent (bool, optional) – Whether to return the mantissa and exponent separately.

  • check_zero (bool, optional) – Whether to check for zero values and return zero early.