tensorcircuit.templates.ansatzΒΆ
Shortcuts for reusable circuit ansatz
- tensorcircuit.templates.ansatz.QAOA_ansatz_for_Ising(params: List[float], nlayers: int, pauli_terms: Any, weights: List[float], full_coupling: bool = False, mixer: str = 'X') Any[source]ΒΆ
Construct the QAOA ansatz for the Ising Model. The number of qubits is determined by pauli_terms.
- Parameters:
params β A list of parameter values used in the QAOA ansatz.
nlayers β The number of layers in the QAOA ansatz.
weights β A list of weights corresponding to each Pauli term.
(optional) (full_coupling) β A flag indicating whether to use all-to-all coupling in mixers. Default is False.
- Pauli_terms:
A list of Pauli terms, where each term is represented as a list of 0/1 series.
- Paran mixer (optional):
The mixer operator to use. Default is βXβ. The other options are βXYβ and βZZβ.
- Returns:
QAOA ansatz for Ising model.