Skip to content

Commit

Permalink
added EfficientSU2
Browse files Browse the repository at this point in the history
  • Loading branch information
01110011011101010110010001101111 committed Aug 1, 2023
1 parent a58a0d5 commit 3be6d58
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions torchquantum/layer/nlocal.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,31 @@ def __init__(
reps=reps,
skip_final_rotation_layer=skip_final_rotation_layer,
)


class EfficientSU2(TwoLocal):
"""Layer Template for a EfficientSU2 circuit
Args:
arch (dict): circuit architecture in a dictionary format
entanglement_layer (str): type of entanglement layer in a string ("linear", "reverse_linear", "circular", "full") or tq.QuantumModule format
reps (int): number of reptitions of the rotation and entanglement layers in a integer format
skip_final_rotation_layer (bool): whether or not to add the final rotation layer as a boolean
"""

def __init__(
self,
arch: dict = None,
entanglement_layer: str = "reverse_linear",
reps: int = 3,
skip_final_rotation_layer: bool = False,
):
# construct circuit with rotation layers of RY and RZ and entanglement with CX
super().__init__(
arch=arch,
rotation_ops=[tq.RY, tq.RZ],
entanglement_ops=[tq.CNOT],
entanglement_layer=entanglement_layer,
reps=reps,
skip_final_rotation_layer=skip_final_rotation_layer,
)

0 comments on commit 3be6d58

Please sign in to comment.