Skip to content

Commit

Permalink
Update katas/content/preparing_states/even_sup_two_qubits_phase_flip/…
Browse files Browse the repository at this point in the history
…solution.md

Co-authored-by: Mariia Mykhailova <[email protected]>
  • Loading branch information
SoniaLopezBravo and tcNickolas authored Aug 19, 2024
1 parent 88bcc25 commit 956b675
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This gate will perform a phase flip only on the $\ket{1}$ state:

$$Z(\alpha\ket{0} + \beta\ket{1}) = \alpha\ket{0} - \beta\ket{1}$$

In your case, you only want to flip the phase of the $\ket{11}$ state and not the $\ket{01}$ state. To accomplish this, you can use a controlled $Z$ gate; this will make sure that the $Z$ gate is only applied if the control bit is in the $\ket{1}$ state, and the $\ket{01}$ state won't change.
In this case, you only want to flip the phase of the $\ket{11}$ state and not the $\ket{01}$ state. To accomplish this, you can use a controlled $Z$ gate; this will make sure that the $Z$ gate is only applied if the control bit is in the $\ket{1}$ state, and the $\ket{01}$ state won't change.

> In Q#, you can apply a controlled gate by using the `Controlled` keyword before the gate. The controlled gate will take two parameters; the first parameter is an array of control qubits (you can have multiple qubits used as a control), and the second parameter is a tuple of parameters passed to the original gate (in this case it's just the qubit to which you want to apply the gate if the control bit is $\ket{1}$).
Expand Down

0 comments on commit 956b675

Please sign in to comment.