PacDessert1436.QSharpApp.Template
1.0.10
See the version list below for details.
dotnet new install PacDessert1436.QSharpApp.Template@1.0.10
PacDessert1436.QSharpApp.Template
A .NET template for creating Q# (QSharp) console applications, with Quantum Game of Life as an example implementation.
Important Note: Only version 1.0.10 is the first stable release with all packaging issues resolved. Please use this version for new Q# projects. Previous versions contain critical deployment errors, including the NuGet package artifact bug on 1.0.7 through 1.0.9 (see Packaging Issues on Previous Versions for details).
Features
- 🚀 Ready-to-use Q# console application template
- 🎮 Quantum Game of Life simulation using quantum randomness
- 📦 Pre-configured with Microsoft Quantum Development Kit
- ✨ Clean project structure with best practices
Getting Started
Prerequisites
- .NET 8 SDK or later
- Microsoft Quantum Development Kit (QDK)
Installation
Install the template from NuGet:
dotnet new install PacDessert1436.QSharpApp.Template
Or install locally from source:
cd QSharpAppTemplate
dotnet new install .
Create a New Project
Use the template to create a new Q# console application:
dotnet new qsharpapp -n MyQuantumApp
cd MyQuantumApp
Run the Application
dotnet run
Template Structure
MyQuantumApp/
├── AppMain.qs # Main Q# program with Game of Life
└── MyQuantumApp.csproj # Project configuration
Quantum Game of Life
This template implements Conway's Game of Life using quantum randomness for initial grid generation. Each cell's initial state is determined by measuring a qubit in superposition, creating a truly random starting configuration.
Key Q# Operations
QuantumRandomBit()- Generates a random bit using quantum superpositionGenerateRandomGrid()- Creates a grid with quantum-random initial statesNextGeneration()- Computes the next generation using Game of Life rulesPrintGrid()- Displays the grid in the console
Configuration
Modify the Main() operation in AppMain.qs to customize:
let cfg = GameOfLifeConfig(Width, Height, Generations);
- Width: Number of columns in the grid (default: 30)
- Height: Number of rows in the grid (default: 10)
- Generations: Number of simulation steps (default: 15)
Game of Life Rules
The simulation follows Conway's classic rules:
- Alive cell (
#symbol) survives if it has 2 or 3 live neighbors - Dead cell (
.symbol) becomes alive if it has exactly 3 live neighbors - All other cells die or remain dead
Development
Build the Template
cd QSharpAppTemplate
dotnet pack
Test the Template
dotnet new qsharpapp -o TestApp
cd TestApp
dotnet run
License
This project is licensed under the BSD 3-Clause License. See the LICENSE file for details.
Resources
Packaging Issues on Previous Versions
- ❌ 1.0.0: Incorrectly included LICENSE file and misplaced
.template.configfolder. - ❌ 1.0.1: Missing actual project content (Q# program and the project file).
- ❌ 1.0.2: Missing the template configuration folder (
.template.config). - ❌ 1.0.3: Incorrect file paths for template content, causing the same issue as 1.0.1.
- ❌ 1.0.4: Still missing actual project content (same issue as the previous version).
- ❌ 1.0.5: Still missing actual project content (same issue as the previous version).
- ❌ 1.0.6: Missing
.template.configdirectory, preventing template installation. - ❌ 1.0.7: NuGet package artifacts (
.template.config,_rels,packagedirectories,.nupkgfiles) incorrectly included in generated project output. - ❌ 1.0.8: Still contains incorrect package artifacts in project output.
- ❌ 1.0.9: Still contains incorrect package artifacts in project output.
- ✅ 1.0.10: All packaging issues resolved by giving up the
.nuspecfile configuration. The very first feature-complete release with correct template structure and content.
-
net8.0
- Microsoft.Quantum.EntryPointDriver (>= 0.28.302812)
- Microsoft.Quantum.QSharp.Core (>= 0.28.302812)
- Microsoft.Quantum.Runtime.Core (>= 0.28.302812)
- Microsoft.Quantum.Standard (>= 0.28.302812)
- Microsoft.Quantum.Targets.Interfaces (>= 0.28.302812)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.