Skip to content

Commit

Permalink
Update one_qubit_decompose.py
Browse files Browse the repository at this point in the history
a by-hand attempt at reformatting the docstring
  • Loading branch information
ecpeterson authored Jul 6, 2021
1 parent 97b7f00 commit c3e7d6c
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions qiskit/quantum_info/synthesis/one_qubit_decompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,22 @@ def _circuit_kak(
K(phi) . A(theta) . K(lam) , where K and A are an orthogonal pair drawn from RZGate, RYGate,
and RXGate.
Behavior flags:
`simplify` indicates whether gates should be elided / coalesced where possible.
`allow_non_canonical` indicates whether we are permitted to reverse the sign of the
middle parameter, theta, in the output. When this and `simplify` are both enabled,
we take the opportunity to commute half-rotations in the outer gates past the middle
gate, which permits us to coalesce them at the cost of reversing the sign of theta.
NOTE: The input value of `theta` is expected to lie in [0, pi).
Args:
theta (float): The middle KAK parameter. Expected to lie in [0, pi).
phi (float): The first KAK parameter.
lam (float): The final KAK parameter.
phase (float): The input global phase.
k_gate (Callable): The constructor for the K gate Instruction.
a_gate (Callable): The constructor for the A gate Instruction.
simplify (bool): Indicates whether gates should be elided / coalesced where possible.
allow_non_canonical (bool): Indicates whether we are permitted to reverse the sign of
the middle parameter, theta, in the output. When this and `simplify` are both
enabled, we take the opportunity to commute half-rotations in the outer gates past
the middle gate, which permits us to coalesce them at the cost of reversing the sign
of theta.
Returns:
QuantumCircuit: The assembled circuit.
"""
gphase = phase - (phi + lam) / 2
qr = QuantumRegister(1, "qr")
Expand Down

0 comments on commit c3e7d6c

Please sign in to comment.