LayerModel¶
- class LayerModel(L, H2, H1=None, cyclic=False)[source]¶
Bases:
LocalHam1DA 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
LayerModelfrom 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
LayerModelconstructor.
- Returns:
A new LayerModel instance.
- Raises:
NotImplementedError – if an unsupported quantum gate is encountered.
- Return type: