page_type | languages | products | description | ||
---|---|---|---|---|---|
sample |
|
|
This sample implements a quantum random number generator using Q#, a good first example to teach how to use the language. |
This sample implements a quantum random number generator, a very simple application that is useful to learn how to write a first Q# program.
In the Q# code (Qrng.qs) you will find the Q# operation for extracting a random bit using quantum measurements over a qubit in superposition. For more information, you can take a look at the full tutorial.
You will also find a Q# operation that creates a random integer from 0 to a maximum integer by invoking several times the Q# operation for extracting a random bit.
qsharp
Python package (optional for usage with Python host program).To run the sample, use the dotnet run
command from your terminal. To run the sample via the Python host program, run python host.py
from your terminal.
Вы можете оставить комментарий после Вход в систему
Неприемлемый контент может быть отображен здесь и не будет показан на странице. Вы можете проверить и изменить его с помощью соответствующей функции редактирования.
Если вы подтверждаете, что содержание не содержит непристойной лексики/перенаправления на рекламу/насилия/вульгарной порнографии/нарушений/пиратства/ложного/незначительного или незаконного контента, связанного с национальными законами и предписаниями, вы можете нажать «Отправить» для подачи апелляции, и мы обработаем ее как можно скорее.
Опубликовать ( 0 )