CNOTLadderAnsatz#
- class pyqit.ansatzes.CNOTLadderAnsatz(n_qubits: int, n_layers: int = 6)[source]#
Bases:
BaseAnsatzThe variational block of Mari et al. (2020): a CNOT ladder, then RY.
Each layer applies CNOT to the wire pairs
(0, 1), (2, 3), ..., then to(1, 2), (3, 4), ..., then one RY per wire.- Parameters:
n_qubits (int)
n_layers (int, default 6) –
q_depthin the paper.
References
Mari, Bromley, Izaac, Schuld, Killoran, “Transfer learning in hybrid classical-quantum neural networks”, Quantum 4, 340 (2020). PennyLane’s “Quantum transfer learning” demo is the reference implementation.
- build_circuit(weights)[source]#
Apply the layers. Expects weights[“weights”] of shape (n_layers, n_qubits).
- get_circuit_func()#
Returns the bound method to be passed to a QNode.