Skip to content

Commit

Permalink
Remove def old_num_basis_gate
Browse files Browse the repository at this point in the history
  • Loading branch information
jlapeyre committed Jan 24, 2024
1 parent 048d125 commit b70e88e
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions qiskit/quantum_info/synthesis/two_qubit_decompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -1417,29 +1417,6 @@ def num_basis_gates(self, unitary):
self.basis.b, self.basis_fidelity, np.asarray(unitary, dtype=complex)
)

def old_num_basis_gates(self, unitary):
"""Computes the number of basis gates needed in
a decomposition of input unitary
"""
unitary = np.asarray(unitary, dtype=complex)
a, b, c = weyl_coordinates(unitary)[:]
traces = [
4
* (
math.cos(a) * math.cos(b) * math.cos(c)
+ 1j * math.sin(a) * math.sin(b) * math.sin(c)
),
4
* (
math.cos(np.pi / 4 - a) * math.cos(self.basis.b - b) * math.cos(c)
+ 1j * math.sin(np.pi / 4 - a) * math.sin(self.basis.b - b) * math.sin(c)
),
4 * math.cos(c),
4,
]
return np.argmax([trace_to_fid(traces[i]) * self.basis_fidelity**i for i in range(4)])


class TwoQubitDecomposeUpToDiagonal:
"""
Class to decompose two qubit unitaries into the product of a diagonal gate
Expand Down

0 comments on commit b70e88e

Please sign in to comment.