A method, performed by a quantum computing device, for applying a target phase to a first qubit of the quantum computing device and a second qubit of the quantum computing device by performing a phase operation on the first and second qubit using a third qubit of the quantum computing device prepared in a phased plus state, wherein the phased plus state comprises a plus state |+〉 = (|0〉 + 1 / 2 that has been phased by an angle equivalent to the target phase, where |o> and |1> are basis states, wherein applying the target phase to the first and second qubits comprises: performing a first NOT operation on the third qubit; computing a controlled adder operation on the first, second and third qubits, comprising: performing a multi target CNOT on the first, second and third qubits, wherein the first qubit acts as the control; computing a logical AND operation between the second and third qubits and encoding the result of the logical AND computation in a fourth qubit; and performing a CNOT operation between the first qubit and the fourth qubit, wherein the first qubit acts as the control; performing a square of the phase operation on the fourth qubit; uncomputing the controlled adder operation on the first, second and third qubits, comprising: performing a CNOT operation between the first qubit and the fourth qubit, wherein the first qubit acts as the control; un-computing a logical AND operation between the second and third qubits; and performing a multi target CNOT operation on the first, second and third qubits, wherein the first qubit acts as the control; performing a CNOT operation between the first qubit and the third qubit, wherein the first qubit acts as the control; performing a CNOT operation between the second qubit and the third qubit, wherein the second qubit acts as the control; and performing a second NOT operation on the third qubit. performing a first NOT operation on the third qubit; computing a controlled adder operation on the first, second and third qubits, comprising: performing a multi target CNOT on the first, second and third qubits, wherein the first qubit acts as the control; computing a logical AND operation between the second and third qubits and encoding the result of the logical AND computation in a fourth qubit; and performing a CNOT operation between the first qubit and the fourth qubit, wherein the first qubit acts as the control; computing a logical AND operation between the second and third qubits and encoding the result of the logical AND computation in a fourth qubit; and performing a CNOT operation between the first qubit and the fourth qubit, wherein the first qubit acts as the control; performing a square of the phase operation on the fourth qubit; uncomputing the controlled adder operation on the first, second and third qubits, comprising: performing a CNOT operation between the first qubit and the fourth qubit, wherein the first qubit acts as the control; un-computing a logical AND operation between the second and third qubits; and performing a multi target CNOT operation on the first, second and third qubits, wherein the first qubit acts as the control; performing a CNOT operation between the first qubit and the fourth qubit, wherein the first qubit acts as the control; un-computing a logical AND operation between the second and third qubits; and performing a multi target CNOT operation on the first, second and third qubits, wherein the first qubit acts as the control; performing a CNOT operation between the first qubit and the third qubit, wherein the first qubit acts as the control; performing a CNOT operation between the second qubit and the third qubit, wherein the second qubit acts as the control; and performing a second NOT operation on the third qubit.