quairkit.ansatz.layer

The source file of the class for quantum circuit templates.

class quairkit.ansatz.layer.LinearEntangledLayer(qubits_idx, depth, param=None)

Linear entangled layers consisting of Ry gates, Rz gates, and CNOT gates.

Parameters:
qubits_idx : List[int]

Indices of the qubits on which the layer is applied.

depth : int

Number of layers.

param : Tensor | None

Initial parameters for the layer. Defaults to be self-generated.

class quairkit.ansatz.layer.RealEntangledLayer(qubits_idx, depth, param=None)

Strongly entangled layers consisting of Ry gates and CNOT gates.

Parameters:
qubits_idx : List[int]

Indices of the qubits on which the layer is applied.

depth : int

Number of layers. Defaults to 1.

param : Tensor | None

Initial parameters for the layer. Defaults to be self-generated.

Note

The mathematical representation of this layer of quantum gates is a real unitary matrix. This ansatz is from the following paper: https://arxiv.org/pdf/1905.10876.pdf.

class quairkit.ansatz.layer.ComplexEntangledLayer(qubits_idx, depth, param=None)

Strongly entangled layers consisting of single-qubit rotation gates and CNOT gates.

Parameters:
qubits_idx : List[int]

Indices of the qubits on which the layer is applied.

depth : int

Number of layers. Defaults to 1.

param : Tensor | None

Initial parameters for the layer. Defaults to be self-generated.

Note

The mathematical representation of this layer of quantum gates is a complex unitary matrix. This ansatz is from the following paper: https://arxiv.org/abs/1804.00633.

class quairkit.ansatz.layer.ComplexBlockLayer(qubits_idx, depth, param=None)

Weakly entangled layers consisting of CNOT gates surrounded by U3 gates

Parameters:
qubits_idx : List[int]

Indices of the qubits on which the layer is applied.

depth : int

Number of layers. Defaults to 1.

param : Tensor | None

Initial parameters for the layer. Defaults to be self-generated.

Note

The mathematical representation of this layer of quantum gates is a complex unitary matrix.

class quairkit.ansatz.layer.RealBlockLayer(qubits_idx, depth, param=None)

Weakly entangled layers consisting of CNOT gates surrounded by RY gates

Parameters:
qubits_idx : List[int]

Indices of the qubits on which the layer is applied.

depth : int

Number of layers. Defaults to 1.

param : Tensor | None

Initial parameters for the layer. Defaults to be self-generated.

Note

The mathematical representation of this layer of quantum gates is a real unitary matrix.

class quairkit.ansatz.layer.Universal2(qubits_idx, param=None)

A circuit layer representing universal two-qubit gates. One of such a layer requires 15 parameters.

Parameters:
qubits_idx : List[int]

Indices of the qubits on which the layer is applied.

param : Tensor | None

Initial parameters for the layer. Defaults to be self-generated.

class quairkit.ansatz.layer.Universal3(qubits_idx, param=None)

A circuit layer representing universal three-qubit gates. One of such a layer requires 81 parameters.

Parameters:
qubits_idx : List[int]

Indices of the qubits on which the layer is applied.

param : Tensor | None

Initial parameters for the layer. Defaults to be self-generated.