Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Onboard the H₂ command line sample to the samples browser. (#285)
Browse files Browse the repository at this point in the history
* Onboard the H₂ command line sample to the samples browser.

* Change C# / Visual Studio 2019 instructions to use anycode.

* Apply anycode instructions to other samples as well.
  • Loading branch information
Chris Granade committed Dec 31, 2019
1 parent b51921c commit 5d4979d
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 8 deletions.
2 changes: 1 addition & 1 deletion samples/algorithms/chsh-game/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dotnet run

### C# in Visual Studio 2019

Open the `algorithms.sln` solution in Visual Studio and set `chsh-game/CHSHGame.csproj` as the startup project.
Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set `CHSHGame.csproj` as the startup project.
Press Start in Visual Studio to run the sample.

## Manifest
Expand Down
2 changes: 1 addition & 1 deletion samples/algorithms/simple-grover/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dotnet run

### C# in Visual Studio 2019 ###

Open the `algorithms.sln` solution in Visual Studio, then right-click on **SimpleGroverSample** and select "Set As StartUp Project."
Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set `SimpleGroverSample.csproj` as the startup project.
Press Start in Visual Studio to run the sample.

## Manifest ##
Expand Down
3 changes: 1 addition & 2 deletions samples/characterization/phase-estimation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ dotnet run

### C# in Visual Studio 2019 ###

Open the `characterization.sln` solution in Visual Studio and set `phase-estimation/PhaseEstimationSample.csproj` as the startup project.
Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set `PhaseEstimationSample.csproj` as the startup project.
Press Start in Visual Studio to run the sample.


## Manifest ##

- [PhaseEstimationSample.csproj](https://github.com/microsoft/Quantum/tree/master/samples/characterization/phase-estimation/PhaseEstimationSample.csproj): Main C# project for the example.
Expand Down
2 changes: 1 addition & 1 deletion samples/getting-started/measurement/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ dotnet run

### C# in Visual Studio 2019

Open the `getting-started.sln` solution in Visual Studio and set `measurement/Measurement.csproj` as the startup project.
Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set `Measurement.csproj` as the startup project.
Press Start in Visual Studio to run the sample.

## Manifest
Expand Down
2 changes: 1 addition & 1 deletion samples/getting-started/qrng/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dotnet run

### C# in Visual Studio 2019 ###

Open the `getting-started.sln` solution in Visual Studio, then right-click on **Qrng** and select "Set As StartUp Project."
Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set `Qrng.csproj` as the startup project.
Press Start in Visual Studio to run the sample.

## Manifest ##
Expand Down
2 changes: 1 addition & 1 deletion samples/getting-started/simple-algorithms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dotnet run

### C# in Visual Studio 2019

Open the `getting-started.sln` solution in Visual Studio and set `simple-algorithms/SimpleAlgorithms.csproj` as the startup project.
Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set `SimpleAlgorithms.csproj` as the startup project.
Press Start in Visual Studio to run the sample.

## Manifest
Expand Down
2 changes: 1 addition & 1 deletion samples/getting-started/teleportation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dotnet run

### C# in Visual Studio 2019 ###

Open the `getting-started.sln` solution in Visual Studio and set `teleportation/TeleportationSample.csproj` as the startup project.
Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set `TeleportationSample.csproj` as the startup project.
Press Start in Visual Studio to run the sample.

## Manifest ##
Expand Down
51 changes: 51 additions & 0 deletions samples/simulation/h2/command-line/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
page_type: sample
languages:
- qsharp
- python
- csharp
products:
- qdk
urlFragment: h2-command-line
description: "This sample demonstrates using Quantum Development Kit to estimate ground state energies of molecular hydrogen."
---

# H₂ Simulation Sample (Command Line)

This sample demonstrates using Q# to estimate the ground state energy of molecular hydrogen (H₂), outputting the results to the command line.

## Prerequisites

- The Microsoft [Quantum Development Kit](https://docs.microsoft.com/quantum/install-guide/).

## Running the Sample

This sample can be run in a number of different ways, depending on your preferred environment.

### Python in Visual Studio Code or the Command Line

At a terminal, run the following command:

```bash
python host.py
```

### C# in Visual Studio Code or the Command Line

At a terminal, run the following command:

```dotnetcli
dotnet run
```

### C# in Visual Studio 2019

Open the folder containing this sample in Visual Studio ("Open a local folder" from the Getting Started screen or "File → Open → Folder..." from the menu bar) and set `H2SimulationSampleCmdLine.csproj` as the startup project.
Press Start in Visual Studio to run the sample.

## Manifest

- [Operations.qs](https://github.com/microsoft/Quantum/blob/master/samples/simulation/h2/command-line/Operations.qs): Q# code defining how estimate H₂ energy levels.
- [Host.cs](https://github.com/microsoft/Quantum/blob/master/samples/simulation/h2/command-line/Host.cs): C# code to call the operations defined in Q#.
- [H2SimulationSampleCmdLine.csproj](https://github.com/microsoft/Quantum/blob/master/samples/simulation/h2/command-line/H2SimulationSampleCmdLine.csproj): Main C# project for the example.
- [host.py](https://github.com/microsoft/Quantum/blob/master/samples/getting-started/teleportation/host.py): a sample Python program to call the Q# simulation operation.

0 comments on commit 5d4979d

Please sign in to comment.