LayerModel¶
- class LayerModel(L, H2, H1=None, cyclic=False)[source]¶
Bases:
LocalHam1D
A model for representing a layer of time-evolution interactions.
Essentially, this class is a simple wrapper of
quimb.tensor.LocalHam1D
. Its main purpose is to provide a simple interface for constructing a Quimb-compatible Hamiltonian from Qiskit objects.Methods
- classmethod from_quantum_circuit(circuit, *, keep_only_odd=None, **kwargs)[source]¶
Construct a
LayerModel
from aQuantumCircuit
.You can see an example of this function in action in the docs of
quimb_layers
.- Parameters:
circuit (QuantumCircuit) – the quantum circuit to parse.
keep_only_odd (bool | None) – whether to keep only interactions on bonds with odd indices.
kwargs – any additional keyword arguments to pass to the
LayerModel
constructor.
- Returns:
A new LayerModel instance.
- Raises:
NotImplementedError – if an unsupported quantum gate is encountered.
- Return type: