O'Reilly logo

Hands-On Machine Learning with C# by Matt R. Cole

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

M

This measures a single qubit in the Pauli-Z basis such that the output result is given by the distribution. The M operation is defined as:

Pr(Zero||ψ  )=  ψ|0 ⟩⟨ 0|ψ 

How does the Q# language differ from C#? Here are a few points.

The using statement is different from that of C#. It's used to allocate an array of qubits for processing. Like the using statement in C#, the qubits are released at the end of the using statement. There are no qubits that are used for the entire lifetime of the application.

Q# has a different for loop that is used to iterate through a range. There is no direct equivalent of a C# for loop.

Q#, by default, has all variables as immutable, meaning that once they are assigned, they cannot be changed. There is a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required