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
- Microsoft Quantum Development Kit
- Q# Reference, M operation
- Q# Reference, H operation
- El Bruno, Information about Simulators on Microsoft Quantum Development Kit (Do you have 16 TB RAM?)
- El Bruno, Hello QWorld using Microsoft #Quantum Development Kit (fix to build the project) [Updated]
- El Bruno, More information about the Microsoft bet in Quantum Computing
- El Bruno, Quantum Computing, let’s add this one to Artificial Intelligence and Mixed Reality!
Images
12 comments