Git Product home page Git Product logo

quantum-docs-pr's Introduction

Microsoft Quantum Documenation


NOTE: Effective Februrary, 2021, this repository will move to https://github.com/MicrosoftDocs/quantum-docs. To contribute documentation, please visit our new repository.


Welcome to the official documentation repository for the Microsoft Quantum Development Kit.

This repository contains open-source documentation articles and automatically generated API files. There are two main folders:

⚠️ If you want to modify an article of the API reference, DO NOT modify the *.yml file in this repository, as any changes would be automatically overwritten in the next build. These files are automatically generated from the comments in the language source code files, which are located in the repositories Quantum Libraries and Q# runtime. To modify the article you should locate the original source file, apply the changes in the comments there, and submit the pull request to its respective repository. For more details, please see the documentation section of the contribution guide.

📝 If your changes are only editorial, without association to the API, this is the right place to do it. You can directly edit the *.md and *.yml files here.

Getting started

If you are new to the QDK documentation and want to learn how to contribute you can follow our Contributors Guide.

Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

quantum-docs-pr's People

Contributors

adkinn avatar anjbur avatar anpaz avatar bettinaheim avatar bradben avatar bromeg avatar cgranade avatar cjgronlund avatar cmcclister avatar cpalmer2020 avatar duncanma avatar geduardo avatar gillenhaalb avatar jhenshaw avatar kittyyeungq avatar ksvore avatar martinquantum avatar mikedodaro avatar nathanwiebe avatar nathanwiebe2000 avatar natke avatar nschonni avatar qinezh avatar quantumwriter avatar ricardo-espinoza avatar rmshaffer avatar syntaxc4 avatar tcnickolas avatar vadym-kl avatar vxfield avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quantum-docs-pr's Issues

Update instructions for VS code extension

As it stands, creating a new Q# project fails if you install the VS code extension, using these instructions: https://docs.microsoft.com/en-us/quantum/quickstart?tabs=tabid-vscode&view=qsharp-preview

The templates need to be installed as a separate step:

From within VS you can create a new project with the standard GUI option (right click solution, new project etc). If you want to create a project from the command line you have to install the project templates, which are a separate nuget package: https://www.nuget.org/packages/Microsoft.Quantum.ProjectTemplates/0.9.1908.2906

Microsoft.Quantum.Primitive namespace still used in trace simulator docs`

With 0.6, the Microsoft.Quantum.Primitive namespace was deprecated in favor of Microsoft.Quantum.Intrinsic, but the trace simulator page still uses the old name.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

VSCode installation?

Hey there. Not sure where to ask but somehow found that similar to #335 so, I have no issue on dotnet restore and dotnet run my new project but VSCode fails like this,

[Error - 11:09:11 PM] MSBuild error in /opt/dotnet/sdk/2.2.100/NuGet.targets(123,7): The "RestoreForceEvaluate" parameter is not supported by the "RestoreTask" task. Verify the parameter exists on the task, and it is a settable public instance property.
[Error - 11:09:11 PM] MSBuild error in /opt/dotnet/sdk/2.2.100/NuGet.targets(114,5): The "RestoreTask" task could not be initialized with its input parameters. 
[Error - 11:09:11 PM] Failed to restore project '.../Bell/Bell.csproj'.
[Error - 11:09:11 PM] MSBuild error in /opt/dotnet/sdk/2.2.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(208,5): The "ResolvePackageAssets" task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly 'NuGet.Frameworks, Version=4.9.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621)
File name: 'NuGet.Frameworks, Version=4.9.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheWriter..ctor(ResolvePackageAssets task, Stream stream)
   at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader.CreateReaderFromMemory(ResolvePackageAssets task, Byte[] settingsHash)
   at Microsoft.NET.Build.Tasks.ResolvePackageAssets.CacheReader..ctor(ResolvePackageAssets task)
   at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ReadItemGroups()
   at Microsoft.NET.Build.Tasks.ResolvePackageAssets.ExecuteCore()
   at Microsoft.NET.Build.Tasks.TaskBase.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

Any pointer?

Jupyter kernel iqsharp wants old .NET version 2

Current version of .NET is 3; after installing this and trying to install the Jupyter kernel, got an error message. The kernel won't install unless it finds .NET 2; it did install after installing the older .NET version.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Control Flow example

I think that the variable "i" should be "index" in following code (control flow example).

// ...
for (qb in qubits) { // qubits contains a Qubit[]
H(qb);
}

mutable results = new (Int, Results)[Length(qubits)];
for (index in 0 .. Length(qubits) - 1) {
let measured =
set results w/= index <- (index, M(qubits[i]));
}

mutable accumulated = 0;
for ((index, measured) in results) {
if (measured == One) {
set accumulated += 1 <<< index;
}
}


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Invalid xref

1 invalid cross reference(s) ""microsoft.quantum.language.statements"".


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Unable to find package microsoft.quantum.iqsharp. No packages exist with this id

image

Briefly:
following instructions, cant install iqsharp.

in text:
C:\WINDOWS\system32>dotnet --list-sdks
2.1.503 [C:\Program Files\dotnet\sdk]
2.1.505 [C:\Program Files\dotnet\sdk]
2.1.602 [C:\Program Files\dotnet\sdk]
2.2.105 [C:\Program Files\dotnet\sdk]
2.2.202 [C:\Program Files\dotnet\sdk]

C:\WINDOWS\system32>dotnet tool install -g Microsoft.Quantum.IQSharp

Welcome to .NET Core!

Learn more about .NET Core: https://aka.ms/dotnet-docs
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli-docs

Telemetry

The .NET Core tools collect usage data in order to help us improve your experience. The data is anon
ymous and doesn't include command-line arguments. The data is collected by Microsoft and shared with
the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment
variable to '1' or 'true' using your favorite shell.

Read more about .NET Core CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

ASP.NET Core

Successfully installed the ASP.NET Core HTTPS Development Certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only). For establis
hing trust on other platforms refer to the platform specific documentation.
For more information on configuring HTTPS see https://go.microsoft.com/fwlink/?linkid=848054.
error NU1101: Unable to find package microsoft.quantum.iqsharp. No packages exist with this id in so
urce(s): C:\Program Files\dotnet\sdk\NuGetFallbackFolder, Microsoft Visual Studio Offline Packages
The tool package could not be restored.
Tool 'microsoft.quantum.iqsharp' failed to install. This failure may have been caused by:

  • You are attempting to install a preview release and did not use the --version option to specify th
    e version.
  • A package by this name was found, but it was not a .NET Core tool.
  • The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
  • You mistyped the name of the tool.****

Numerics package documentation

I've seen that some operations (e.g. "Carry") are included in the Microsoft.Quantum.Arithmetic namespace by default, whilst there are some (e.g. "AddI") that need the Microsoft.Quantum.Numerics package installed.

It would be helpful if this could be refenced somewhere in the documentation, for example in the summary of Microsoft.Quantum.Arithmetic, that some of the operations in Arithmetic require the Numerics package with a link to the installation.

Thanks,
Frances

First instruction for Update is confusing

  1. Consult Nuget.org for the PackageReference number, "0.n.xxxx.yyy" for the Microsoft Quantum Development Kit package.
    -> This is not a helpful instruction for folks unfamiliar with Nuget. We shouldn't expect any deep knowledge about Nuget, and we should rephrase "0.n.xxxx.yyy" to instead say something around picking up the latest version.
  2. Projects need to be upgraded in order. If you have a solution with multiple projects, update each project in the order they are referenced.
    -> Can we include some detail here on how a user can check in which order their projects are referenced?

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Trying to help with code documentation for the Bell example!

Hi guys! What a wonderful work in the Quantum quick start projects and the Q# overall documentation!
Really congratulations!

So, I'm here because, while I was studying and trying to understand the bell example code, I written down a LOT of comments, so after I've finished, I just figure it out that maybe it can be useful for someone else, but I don't know where to post it to help you guys, so that's why I'm opening this issue!
I've documented in a personal repo so, If you guys want to take a look at the Bell.qs file, maybe can help to be in the official docs 💖

Suggestion: New "Learning resources" section

As a recent learner of Q# I found that there are a lot of learning resources but they are sparsed or not explained in the main website. For example, I've been reviewing the main site for one month and I've found just now the two fantastic compilations of resources in https://qsharp.community/ and https://github.com/ebraminio/awesome-qsharp/ by reading issue #466 instead of from the main site.

Most new users will start using and learning Q# through the material presented in the main site, but there is not a complete compilation of learning resources on the main site like the ones cited above (or even an easy to find link to them).

There's the section "For more information", but it seems more oriented to provide useful references for advanced topics of Quantum Computing rather than learning material for Q#.

I wrote a small subsection Learning materials at the beginning of Q# Manual, but still is incomplete and it just will contribute to create more sparsity by adding a new different compilation in another random place.

I think we should create a section (or maybe a subsection on Getting started or Q# manual (?)) on the main site as an official and structured compilation of learning resources, explaining what the resources are for and how to use them depending on the level of expertise of the reader. This will help the reader to have a fixed point of reference for obtaining material. It will also help us by needing to keep up to date one single compilation that we can refer to in other sections, blogs... instead of having to update manually each compilation every time a new resource comes out.

Please, tell me what you think @cgranade, @bettinaheim, @bromeg. As I'm learning Q# from almost zero I could take care of and improve it as I learn and follow the different tutorials.

Step 6

The script under "The full routine now looks like this:" on line 4 or 5, there is an extra "{" that should be removed.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Incorrect Jordan Wigner transform

[Enter feedback here]
In the transformation from the creation operator to its Pauli equivalent, the summation doesn't actually equal the given matrix. Similarly, the annihilation operator doesn't equal it's Pauli equivalent. The actual formulas are used later on in the text, but the first mention is incorrect:

Screen Shot 2019-09-03 at 10 53 16 AM

(also, if possible, the spacing should be fixed)


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Wrong formula in the description of PrepareEntangledState operation

The formula that follows "prepares the maximally entangled state" is incorrect


Document details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Invalid xref in document

1 invalid cross reference(s) ""<xref:microsoft.quantum.canon.preparearbitrarystate>"".


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Contribution guide

The Quantum Development Kit community includes people coming from a wide range of different backgrounds. One thing that might help members of the community who want to get involved with making contributions would be a guide that lists what kinds of contributions there are (e.g.: documentation, filing issues, code contributions), what tools we use to accept contributions (Git, GitHub, etc.), and which repos are used for what kinds of content.

Product symbol

It may be trivial given the context, but what does the $\otimes$ operator actually correspond to? Kronecker product?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Add a link to nuget package update from Visual Studio

For people using Visual Studio, we should point them to https://docs.microsoft.com/en-us/nuget/tools/package-manager-ui#updating-a-package for how to update a package within Visual Studio.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

The "Develop with Python" steps don't work on Mac (10.14.6)

When I run this step:

dotnet iqsharp install

I get this error:

It was not possible to find any compatible framework version
The specified framework 'Microsoft.AspNetCore.App', version '2.2.0' was not found.

  • The following frameworks were found:
    2.1.12 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
    3.0.0-preview9.19424.4 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
    3.0.0 at [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]

You can resolve the problem by installing the specified framework and/or SDK.

The .NET Core frameworks can be found at:

I have the latest version of .NET Core and the latest version of Python installed. OS X version is 10.14.6.

Thanks a lot,

-david


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Issue in an external link

There is a problem for the link in the "File Structure" section. Can you fix it? Thank you ^^
Another thing, is it possible to be in contact with a Q# developer? Because I need help to do something in relation with Q# in Visual Studio. Thank you.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Change § Testing and Debugging to use "fact" vs "assertion" terminology.

The current testing and debugging article uses the term "assertion" to include both assertions (that is, diagnostic operations that depend on state owned by a target machine) and facts (diagnostic functions that depend only on their actual inputs). We should clarify, as these two kinds of diagnostic conditions are semantically distinct, and are referred to in the Q# standard libraries by different names. For example, Microsoft.Quantum.Diagnostics.Fact is a function, while Microsoft.Quantum.Diagnostics.AssertQubitIsInStateWithinTolerance uses the verb "assert" to indicate that the Q# program needs to ask the target machine to check the state associated with the inputs to resolve the condition.

Update conceptual documentation to reflect 0.6 changes

The conceptual documentation should be updated to reflect changes made as a part of the work on microsoft/QuantumLibraries#35.

  • Clarify that the canon is now a part of the Microsoft.Quantum.Standard package.
  • Ensure that snippets in conceptual articles use the correct open statements.
  • Update links to reference docs to make sure that they point to correctly merged documentation.

Fix installation instructions for Linux?

Hey there, I followed installation instructions on for Linux by installing sudo apt-get install dotnet-sdk-2.1 and issuing dotnet new -i "Microsoft.Quantum.ProjectTemplates::0.3.1811.203-preview" and it says

$ dotnet new -i "Microsoft.Quantum.ProjectTemplates::0.3.1811.203-preview"
  Restoring packages for /home/ebrahim/.templateengine/dotnetcli/v2.1.500/scratch/restore.csproj...
  Installing Microsoft.Quantum.ProjectTemplates 0.3.1811.203-preview.
  Generating MSBuild file /home/ebrahim/.templateengine/dotnetcli/v2.1.500/scratch/obj/restore.csproj.nuget.g.props.
  Generating MSBuild file /home/ebrahim/.templateengine/dotnetcli/v2.1.500/scratch/obj/restore.csproj.nuget.g.targets.
  Restore completed in 193.76 ms for /home/ebrahim/.templateengine/dotnetcli/v2.1.500/scratch/restore.csproj.

Usage: new [options]

Options:
  -h, --help    
[...]

Maybe something I'm missing or it is not ".NET Core SDK 2.0 or later"?

No-install getting started link

Doing some prep for a summer school, Inoticed that I think it would be nice to give this link some consideration. It is basically the first place where we send people, and having followed it, I was really missing a "and now do that" kind of continuation/link in the opened notebook that would gently lead a newby towards doing something with it without having a concrete idea in mind of what to code. I'd suggest to link to the katas index?

Add @Private attribute when 0.10 is released

I removed this section from the style guide, as the @Private attributes does exist yet.

### Private or Internal Names ###

In many cases, a name is intended strictly for use internal to a library or project, and is not a guaranteed part of the API offered by a library.
It is helpful to clearly indicate that this is the case when naming functions and operations so that accidental dependencies on internal-only code are made obvious.
If an operation or function is not intended for direct use, but rather should be used by a matching callable which acts by partial application, consider using a name starting with `_` for the callable that is partially applied, and marking the function or operation as private with the <xref:microsoft.quantum.core.private> attribute:

```Q#
@Private()
operation _ApplyDecomposedOperation(decomposition : Int[], targets : Qubit[]) : Unit {
    // ...
}

I will add it back in once 0.10 is release

Invalid xrefs in second quantization

2 invalid cross reference(s) "<xref:Microsoft.Quantum.Chemistry.LadderOperators.LadderOperator>", "<xref:Microsoft.Quantum.Chemistry.LadderOperators.LadderSequence>".


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Python/IQ# installation instructions

I think there might be a line missing in the instructions for installing IQ#:
The section under installing IQ# on https://docs.microsoft.com/en-us/quantum/install-guide/python?view=qsharp-preview does not mention the need to run "dotnet iqsharp install" after "dotnet tool install -g Microsoft.Quantum.IQSharp" which I think is necessary. What makes this particularly confusing is that if you don't run that, then the check (dotnet iqsharp --version) actually works, but IQ# does not (the Q# kernel is not properly registered from what I gather).

AssertQubitState requires explicit Complex() call

From Q# Language User Voice (ID:
34713733):

Example from documentation does not compile:
AssertQubitState(((1., 0.), (0., 0.)), qubits0, 1e-5);
However, this code does:
AssertQubitState((Complex(1., 0.), Complex(0., 0.)), qubits0, 1e-5);
Error being:
Severity Code Description
Error QS0001 Type mismatch for argument: (Microsoft.Quantum.Extensions.Math.Complex, Microsoft.Quantum.Extensions.Math.Complex) expected, but ((Double, Double), (Double, Double)) was provided
Error QS0001 expected type Microsoft.Quantum.Extensions.Math.Complex, instead got type (Double, Double)
Error QS0001 expected type Microsoft.Quantum.Extensions.Math.Complex, instead got type (Double, Double)

QCTraceSimulatorConfiguration field names are incorrect

The field names have been renamed in the code but not on any of the doc pages. Even the auto-generated API docs still show the old names.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Python import qsharp error

When I import qsharp in Python, I see the following error:

import qsharp
Preparing Q# environment...
...................Traceback (most recent call last):

File "", line 1, in
import qsharp

File "D:\Anaconda3\lib\site-packages\qsharp_init_.py", line 119, in
client = _start_client()

File "D:\Anaconda3\lib\site-packages\qsharp\clients_init_.py", line 47, in _start_client
raise Exception("Q# environment was not available in allocated time.")

Exception: Q# environment was not available in allocated time.

How to fix it? Any advice?

Thanks!

Patrickxli

Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Quantum docs pages missing useful github integration

I was reading through the QDK online docs recently and noticed that there are a couple of features/buttons missing from the built docs pages. The feature to be able from the doc page to directly link back to the right file in this repo to make an edit/fix is really helpful, as well as the ability to see if there are open issues on a docs page without going directly to GitHub. You can see an example of this on other MSFT docs sites: https://docs.microsoft.com/en-us/visualstudio/get-started/csharp/tutorial-console?view=vs-2019

There is 2 more buttons in the header,
image

and an embedded GitHub issue thing at the bottom.
image

I feel like these used to exist on the QDK pages, but I am not sure.
Thanks!
Sarah

Maintain and update LaTeX notation

There's a lot of small LaTeX rendering issues here and there caused by the DocFX -> MathJax pipeline that would be good to resolve. In particular, we've set up macros like \ket, \bra, and \id to help typeset different notation, such that relying more heavily on these macros can help make sure that things render consistently.

  • Replace \left|\psi\right\rangle-style notation with \ket{\psi} (same with bra)
  • Replace \mathbb{1} with \id
  • Fix improperly escaped linebreaks

Terminology

I think there is some confusion with variables.

If the following is accepted as true:

  • A matrix of size m×n is a collection of mn complex numbers

Then shouldn't this:

  • Note that a vector of dimension n is simply a matrix of size n×1.
    Actually be:
  • Note that a vector of dimension m is simply a matrix of size m×1.

As "m" denotes row, and "n" denotes column, and vectors have a single column, but can vary in rows.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

A typo

In Installation section, the command

dotnet new console -lang Q# -o myApp
cd MyApp
dotnet run

has a typo, you should write cd myApp.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Step 5

The step 5 is sort of not clear of where (which file) to change those two lines. Can this be addressed if possible?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Teleportation Samples (via Binder/Notebook) is broken

Running the samples results in a Dependency Issue / failure.

I can't cut/paste unfortunately, but the issue with with Powershell and SSL dependencies.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Bug in documentation about AssertQubitState

the example code in:
quantum-docs-pr/api/prelude/microsoft.quantum.extensions.testing.assertqubitstate.yml
does not compile for me.

To make it work I had to:

  • change pair of Doubles to Complex
  • In second invocation of AssetQubitState change from qubits[0] to qubits[1] (From context I guess the idea was that both assertions should not fail)

Thanks!

an identity matrix/operator missing

please check the last equation ( "For example, if we wish to apply the
X gate to the first qubit and then perform a CNOT between the second and third qubits we may express this transformation as"). The dimensions of the two sides of the equation are out of sync.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Link is broken

Link at the bottom of the page in "Multiple chemical representations defined using the Broombridge schema are provided here." is broken.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

link broken: five-qubit perfect code

Link near the end of the article to "five-qubit perfect code" (https://arxiv.org/abs/1305.08) is broken.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Trouble running first QDK Bell test

After having done the steps on the "Writing first program page" my codes (macOS) look like this:

Bell.qs

namespace Quantum.Bell
{
    open Microsoft.Quantum.Canon;
    open Microsoft.Quantum.Intrinsic;

    operation Set (desired: Result, q1: Qubit) : Unit {
        if (desired != M(q1)) {
            X(q1);
        }
    }
    operation BellTest (count : Int, initial: Result) : (Int, Int) {

        mutable numOnes = 0;
        using (qubit = Qubit()) {

            for (test in 1..count) {
                Set (initial, qubit);
                let res = M (qubit);

                // Count the number of ones we saw:
                if (res == One) {
                    set numOnes += 1;
                }
            }
            Set(Zero, qubit);
        }

        // Return number of times we saw a |0> and number of times we saw a |1>
        return (count-numOnes, numOnes);
    }
}

and the Driver.cs looks like this:

using System;

using Microsoft.Quantum.Simulation.Core;
using Microsoft.Quantum.Simulation.Simulators;

namespace BellTest
{
    class Driver
    {
        static void Main(string[] args)
        {
            using (var qsim = new QuantumSimulator())
            {
                // Try initial values
                Result[] initials = new Result[] { Result.Zero, Result.One };
                foreach (Result initial in initials)
                {
                    var res = BellTest.Run(qsim, 1000, initial).Result;
                    var (numZeros, numOnes) = res;
                    System.Console.WriteLine(
                        $"Init:{initial,-4} 0s={numZeros,-4} 1s={numOnes,-4}");
                }
            }

            System.Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
    }
}

However, I get the following error messages upon running:

 Restore completed in 26.27 ms for /Users/danstanescu/Dropbox/JupyterNotebooks/MicrosoftQDK/Bell/Bell.csproj.
/Users/danstanescu/Dropbox/JupyterNotebooks/MicrosoftQDK/Bell/Driver.cs(18,31): error CS0234: The type or namespace name 'Run' does not exist in the namespace 'BellTest' (are you missing an assembly reference?) [/Users/danstanescu/Dropbox/JupyterNotebooks/MicrosoftQDK/Bell/Bell.csproj]
/Users/danstanescu/Dropbox/JupyterNotebooks/MicrosoftQDK/Bell/Driver.cs(19,26): error CS8130: Cannot infer the type of implicitly-typed deconstruction variable 'numZeros'. [/Users/danstanescu/Dropbox/JupyterNotebooks/MicrosoftQDK/Bell/Bell.csproj]
/Users/danstanescu/Dropbox/JupyterNotebooks/MicrosoftQDK/Bell/Driver.cs(19,36): error CS8130: Cannot infer the type of implicitly-typed deconstruction variable 'numOnes'. [/Users/danstanescu/Dropbox/JupyterNotebooks/MicrosoftQDK/Bell/Bell.csproj]
The terminal process terminated with exit code: 1

Any help will be greatly appreciated.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.