Skip to content

Commit

Permalink
Create s_gate directly
Browse files Browse the repository at this point in the history
  • Loading branch information
israelferrazaraujo committed Mar 14, 2023
1 parent fe874ef commit b762b39
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions qiskit/circuit/library/standard_gates/multi_control_su2.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

from typing import Union, List
import numpy as np
from qiskit.circuit import QuantumCircuit, QuantumRegister, Qubit
from qiskit.circuit import QuantumRegister, Qubit
from qiskit.circuit.library.standard_gates.x import MCXVChain

from qiskit.extensions import UnitaryGate

def linear_depth_mcv(
circuit,
Expand Down Expand Up @@ -48,10 +48,8 @@ def linear_depth_mcv(
s_op = np.array([[alpha, -np.conj(beta)], [beta, np.conj(alpha)]])

# S gate definition
s_gate = QuantumCircuit(1)
s_gate.unitary(s_op, 0)
s_gate = s_gate.to_gate()

s_gate = UnitaryGate(s_op)

num_ctrl = len(controls)
k_1 = int(np.ceil(num_ctrl / 2.0))
k_2 = int(np.floor(num_ctrl / 2.0))
Expand Down

0 comments on commit b762b39

Please sign in to comment.