quimb.experimental.belief_propagation.l1bp¶
Classes¶
Lazy 1-norm belief propagation. BP is run between groups of tensors |
Functions¶
|
Estimate the contraction of |
Module Contents¶
- class quimb.experimental.belief_propagation.l1bp.L1BP(tn, site_tags=None, damping=0.0, update='sequential', local_convergence=True, optimize='auto-hq', message_init_function=None, **contract_opts)¶
Bases:
quimb.experimental.belief_propagation.bp_common.BeliefPropagationCommon
Lazy 1-norm belief propagation. BP is run between groups of tensors defined by
site_tags
. The message updates are lazy contractions.- Parameters:
tn (TensorNetwork) – The tensor network to run BP on.
site_tags (sequence of str, optional) – The tags identifying the sites in
tn
, each tag forms a region, which should not overlap. If the tensor network is structured, then these are inferred automatically.damping (float, optional) – The damping parameter to use, defaults to no damping.
update ({'parallel', 'sequential'}, optional) – Whether to update all messages in parallel or sequentially.
local_convergence (bool, optional) – Whether to allow messages to locally converge - i.e. if all their input messages have converged then stop updating them.
optimize (str or PathOptimizer, optional) – The path optimizer to use when contracting the messages.
contract_opts – Other options supplied to
cotengra.array_contract
.
- backend¶
- damping = 0.0¶
- local_convergence = True¶
- update = 'sequential'¶
- optimize = 'auto-hq'¶
- contract_opts¶
- touched¶
- _abs¶
- _max¶
- _sum¶
- _norm¶
- _normalize¶
- _distance¶
- messages¶
- contraction_tns¶
- iterate(tol=5e-06)¶
- contract(strip_exponent=False)¶
- normalize_messages()¶
Normalize all messages such that for each bond <m_i|m_j> = 1 and <m_i|m_i> = <m_j|m_j> (but in general != 1).
- quimb.experimental.belief_propagation.l1bp.contract_l1bp(tn, max_iterations=1000, tol=5e-06, site_tags=None, damping=0.0, update='sequential', local_convergence=True, optimize='auto-hq', strip_exponent=False, info=None, progbar=False, **contract_opts)¶
Estimate the contraction of
tn
using lazy 1-norm belief propagation.- Parameters:
tn (TensorNetwork) – The tensor network to contract.
max_iterations (int, optional) – The maximum number of iterations to perform.
tol (float, optional) – The convergence tolerance for messages.
site_tags (sequence of str, optional) – The tags identifying the sites in
tn
, each tag forms a region. If the tensor network is structured, then these are inferred automatically.damping (float, optional) – The damping parameter to use, defaults to no damping.
update ({'parallel', 'sequential'}, optional) – Whether to update all messages in parallel or sequentially.
local_convergence (bool, optional) – Whether to allow messages to locally converge - i.e. if all their input messages have converged then stop updating them.
optimize (str or PathOptimizer, optional) – The path optimizer to use when contracting the messages.
progbar (bool, optional) – Whether to show a progress bar.
strip_exponent (bool, optional) – Whether to strip the exponent from the final result. If
True
then the returned result is(mantissa, exponent)
.info (dict, optional) – If specified, update this dictionary with information about the belief propagation run.
contract_opts – Other options supplied to
cotengra.array_contract
.