Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunsided/quantum-belltest
Diving into the Q# language
https://github.com/sunsided/quantum-belltest
dotnet qsharp quantum-computing quantum-programming quantum-programming-language
Last synced: 3 days ago
JSON representation
Diving into the Q# language
- Host: GitHub
- URL: https://github.com/sunsided/quantum-belltest
- Owner: sunsided
- Created: 2019-08-06T15:29:06.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-06T15:51:13.000Z (over 5 years ago)
- Last Synced: 2024-11-09T08:17:27.517Z (about 1 month ago)
- Topics: dotnet, qsharp, quantum-computing, quantum-programming, quantum-programming-language
- Language: C#
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Q# - Bell Test Sample
## Installing the SDK / Runtime
The SDK is based on the `dotnet` tooling. Install Q# support (see [here](https://docs.microsoft.com/en-us/quantum/install-guide/command-line?view=qsharp-preview)) using:
```sh
dotnet new -i Microsoft.Quantum.ProjectTemplates
```You can install the Visual Studio Code extension from [here](https://marketplace.visualstudio.com/items?itemName=quantum.quantum-devkit-vscode) by executing
```sh
ext install quantum.quantum-devkit-vscode
```within Visual Studio Code.
## Bell Test Example
Following [Writing a Quantum Program](https://docs.microsoft.com/de-de/quantum/quickstart?tabs=tabid-vscode&view=qsharp-preview), to create a new project, run:
```sh
dotnet new console -lang Q# --output Bell
cd Bell
code . # To open in Visual Studio Code.
```You can build and run it on the command line using
```sh
dotnet build
dotnet run
```## Example output
Here's an example of the program output:
```text
Resource estimation
-------------------
Metric Sum
CNOT 1000
QubitClifford 1000
R 0
Measure 4002
T 0
Depth 0
Width 2
BorrowedWidth 0Experiment
----------
Init:Zero 0s=495 1s=505 agree=1000
Init:One 0s=499 1s=501 agree=1000
```As we see, measuring a qubit's state after putting it into
superposition via the Hadamard gate (`H()`) makes it collapse
into either state |0> or |1> with a 50% chance. However,
since both qubits are entangled (as a Bell pair), both
measurements are always identical (1000 out of 1000 times).