page_type | languages | products | urlFragment | description | ||
---|---|---|---|---|---|---|
sample |
|
|
h2-command-line |
This sample demonstrates using Quantum Development Kit to estimate ground state energies of molecular hydrogen. |
This sample demonstrates using Q# to estimate the ground state energy of molecular hydrogen (H₂), outputting the results to the command line.
- The Microsoft Quantum Development Kit.
This sample can be run in different ways, depending on your preferred environment.
At a terminal, run the following command:
dotnet run
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.
- Operations.qs: Q# code defining how estimate H₂ energy levels.
- Program.qs: Q# entry point to call the operations defined in
Operations.qs
. - H2SimulationSampleCmdLine.csproj: Main C# project for the example.