microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
c2d2246f04df6a928da5b851b624123e4cc719da

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

samples/python_interop/generating_n_random_bits/README.md

3lines · modecode

1# Passing arguments from Python to Q# and processing measurement results in Python
2
3In this example, a Q# program generates an array of random bits of user-defined length (`nQubits`). The program creates a random bit sequence by applying an $H$ gate to each of the qubits, measuring them, and returning a tuple containing the measurement results in an array along with the integer representation of the generated bits or the random number. The Python program then processes the resulting array of bits by counting the number of `One`s and displays this count along with the array of random bits and the integer representation of the generated bits.
4