EfficientSU2Ansatz#
- class pyqit.ansatzes.EfficientSU2Ansatz(n_qubits: int, n_layers: int = 3, entanglement: str = 'reverse_linear', skip_final_rotation_layer: bool = False)[source]#
Bases:
RealAmplitudesAnsatzQiskit’s EfficientSU2: RY and RZ layers separated by CX entanglers.
RealAmplitudesAnsatz with an RZ layer after every RY layer, Qiskit’s default su2_gates. Same parameters and the same reference. The second rotation doubles the weight vector to (2 * n_qubits * (n_layers + 1),).
- build_circuit(weights)#
Apply the circuit. Expects weights[“weights”] as a flat vector in the order of circuit.parameters.
- get_circuit_func()#
Returns the bound method to be passed to a QNode.
- classmethod get_test_params()#
List constructor kwargs used to parametrize this class in the test suite.
- get_weight_shapes() dict#
Return {“weights”: (n_params,)}, Qiskit’s flat parameter vector.