Clipboard02

Hi!

I’m still at the Microsoft Tech Summit Toronto, so it’s time to share another interesting learned lesson from the Microsoft Quantum Development Kit.

In today’s post, I will talk about the possible operations that we can perform on a Qubit. Well, the post is short:

We can only perform test for identity on Qubits (equality).

That’s the only operation we can do with a Qubit in Q#. Not really, we can use and pass Qubits as parameters between operations (reference model), and if we want to modify the state of them we have to use Q# Qubits .

In example, if we want to measure the status of a Qubit, we can use the M() operation

let measure = M(qubit[0]);

If, we want to change the value of Zero to One, or vice versa in a Qubit, we can use the X() operation

X(qubit[0]);

If, we want to apply a Hadamard transformation to a Qubit, we need to use the H() operation, the syntax would be

H(qubit[0]);

Almost all operations can be found under the namespace [Microsoft Quantum. Primitive]. I strongly advise to spend some time reading and understanding how quantum mechanics works before you start working with this type of gates (Pauli Gates). Hey, but this is material for other post!

Happy QCoding!

Greetings @ Microsoft Tech Summit

El Bruno

References

Images

12 responses to “#QuantumDevKit – #Qubit operations in Q#”

Leave a reply to #VS2017 – Using MResetZ() to reset #Qubits in Q# and Microsoft Quantum Development Kit – El Bruno Cancel reply

Discover more from El Bruno

Subscribe now to keep reading and get access to the full archive.

Continue reading