@@ -64,6 +64,7 @@ class InstructionKind(Enum):
6464 SX = enum .auto ()
6565 SXDG = enum .auto ()
6666 CY = enum .auto ()
67+ CH = enum .auto ()
6768 P = enum .auto ()
6869 U = enum .auto ()
6970 CJ = enum .auto ()
@@ -317,6 +318,36 @@ class CY(_KindChecker, ControlledSingleTargetInstruction):
317318 kind : ClassVar [Literal [InstructionKind .CY ]] = field (default = InstructionKind .CY , init = False )
318319
319320
321+ @dataclass (repr = False )
322+ class CH (_KindChecker , ControlledSingleTargetInstruction ):
323+ r"""CH circuit instruction.
324+
325+ The CH gate applies the matrix
326+
327+ .. math::
328+
329+ \left[\begin{matrix}
330+ 1 & 0 & 0 & 0\\
331+ 0 & 1 & 0 & 0\\
332+ 0 & 0 & \frac 1 {\sqrt 2} & \frac 1 {\sqrt 2}\\
333+ 0 & 0 & \frac 1 {\sqrt 2} & -\frac 1 {\sqrt 2}
334+ \end{matrix}\right]
335+
336+ in the computational basis. The basis states use big-endian
337+ ordering, with the most significant qubit first. The qubits are
338+ numbered in the order ``control``, ``target``.
339+
340+ Attributes
341+ ----------
342+ control : int
343+ Index of the control qubit.
344+ target : int
345+ Index of the target qubit.
346+ """
347+
348+ kind : ClassVar [Literal [InstructionKind .CH ]] = field (default = InstructionKind .CH , init = False )
349+
350+
320351@dataclass (repr = False )
321352class CNOT (_KindChecker , ControlledSingleTargetInstruction ):
322353 r"""CNOT circuit instruction.
@@ -1153,6 +1184,7 @@ def visit(self, visitor: InstructionVisitor, *, copy: bool = False) -> GPHASE:
11531184 | CNOT
11541185 | CY
11551186 | CZ
1187+ | CH
11561188 | CCX
11571189 | RZZ
11581190 | SWAP
@@ -1219,6 +1251,7 @@ class Instruction:
12191251 CNOT : TypeAlias = CNOT
12201252 CY : TypeAlias = CY
12211253 CZ : TypeAlias = CZ
1254+ CH : TypeAlias = CH
12221255 CCX : TypeAlias = CCX
12231256 RZZ : TypeAlias = RZZ
12241257 SWAP : TypeAlias = SWAP
@@ -1236,6 +1269,7 @@ def __init__(self) -> None:
12361269 Instruction .CNOT
12371270 | Instruction .CY
12381271 | Instruction .CZ
1272+ | Instruction .CH
12391273 | Instruction .CJ
12401274 | Instruction .CCX
12411275 | Instruction .CRX
0 commit comments