Expand description
Tensor network bridge for quantum-classical hybrid inference.
This module provides conversion between probabilistic graphical models and quantum tensor network representations, enabling efficient computation of marginals and partition functions.
§Overview
Tensor networks provide a natural bridge between:
- Classical PGMs (factor graphs, MRFs)
- Quantum states (MPS, PEPS, MERA)
§Key Concepts
- MPS (Matrix Product State): 1D tensor network for linear chains
- PEPS (Projected Entangled Pair State): 2D tensor network
- Tensor Network Contraction: Computing expectations and marginals
§Example
use tensorlogic_quantrs_hooks::tensor_network_bridge::{
factor_graph_to_tensor_network, TensorNetwork,
};
use tensorlogic_quantrs_hooks::FactorGraph;
let mut graph = FactorGraph::new();
graph.add_variable_with_card("x".to_string(), "Binary".to_string(), 2);
graph.add_variable_with_card("y".to_string(), "Binary".to_string(), 2);
let tn = factor_graph_to_tensor_network(&graph).unwrap();
println!("Tensor network with {} tensors", tn.num_tensors());Structs§
- Matrix
Product State - Matrix Product State (MPS) representation.
- Tensor
- A tensor in the tensor network.
- Tensor
Network - A tensor network representation.
- Tensor
Network Stats - Statistics about a tensor network.
Functions§
- factor_
graph_ to_ tensor_ network - Convert a factor graph to a tensor network.
- linear_
chain_ to_ mps - Convert a Linear Chain CRF to a Matrix Product State.