From b11a679b6d1415db77d696ba83ef487d0e1b59a8 Mon Sep 17 00:00:00 2001 From: hanakl Date: Tue, 26 Nov 2024 01:58:10 -0600 Subject: [PATCH 1/3] Rebase --- docs/src/backendsimulator.md | 0 docs/src/discreteeventsimulator.md | 16 +++++++++++ docs/src/index.md | 19 +++++++++++-- docs/src/manual.md | 45 ++++++++++++++++++++++++++++++ 4 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 docs/src/backendsimulator.md create mode 100644 docs/src/discreteeventsimulator.md diff --git a/docs/src/backendsimulator.md b/docs/src/backendsimulator.md new file mode 100644 index 00000000..e69de29b diff --git a/docs/src/discreteeventsimulator.md b/docs/src/discreteeventsimulator.md new file mode 100644 index 00000000..4eb8483d --- /dev/null +++ b/docs/src/discreteeventsimulator.md @@ -0,0 +1,16 @@ +# [Discrete Event Simulator](@id sim) + +```@meta +DocTestSetup = quote + using QuantumSavory +end +``` + +## Overview + +imulating quantum processes requires robust tools for **Discrete Event Simulator**. In QuantumSavory, we use `ConcurrentSim.jl` and `ResumableFunctions.jl` to model complex, asynchronous processes. + +This simulation framework enables protocols to handle dynamic interactions, such as waiting for resources to become available. + +### **ConcurrentSim.jl** and **ResumableFunctions.jl** +QuantumSavory simulations are structured using [`ConcurrentSim.jl`](https://github.com/JuliaDynamics/ConcurrentSim.jl). A process is defined as a `@resumable` function that yields events, allowing for efficient resource allocation and the expression of protocols that pause until specific conditions are met. These features are essential for implementing waiting mechanisms, such as waiting for messages or changes in a quantum state. diff --git a/docs/src/index.md b/docs/src/index.md index da267be4..a2228001 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -8,7 +8,7 @@ end A multi-formalism simulator for noisy quantum communication and computation hardware with support for symbolic algebra, multiple simulation backends, a variety of noise models, discrete event simulation, optimization, and visualization. -We are also preparing a [getting started manual](@ref manual). +To install QuantumSavory, see: [getting started manual](@ref manual). The rest of the documentation is [structured](https://diataxis.fr/) as follows: @@ -19,7 +19,17 @@ The rest of the documentation is [structured](https://diataxis.fr/) as follows: Depending on your learning style, you might prefer to start at different locations in the above documentation. -Below we demo some of the results of the How-To guides. + +### Capabilities + +QuantumSavory offers advanced features such as: + +- **Hardware Parameter Database**: Detailed records of quantum hardware metrics, enabling realistic simulations and performance benchmarking. +- **Noise Processes Zoo**: A collection of noise models for simulating quantum systems under realistic and complex conditions. +- **Protocols and Circuits Compendium**: Pre-designed quantum circuits and protocols for rapid prototyping and optimization of applications. + + +Below we show some of the results of the How-To guides. #### A simulation of a quantum repeater: @@ -42,4 +52,7 @@ Below we demo some of the results of the How-To guides. This is software is still in a fairly unstable alpha state! The documentation is extremely barebones and current users are expected to read the source code. A good place to start is the How-To pages. -For instance, the [implementation of a first generation repeater](@ref First-Generation-Quantum-Repeater). \ No newline at end of file +For instance, the [implementation of a first generation repeater](@ref First-Generation-Quantum-Repeater). + +### Get Involved +We welcome contributions from experts and students alike, whether by improving the codebase or suggesting new useful features. Your input will help us refine QuantumSavory and support better quantum simulations. diff --git a/docs/src/manual.md b/docs/src/manual.md index 939949fd..3f86d0bd 100644 --- a/docs/src/manual.md +++ b/docs/src/manual.md @@ -6,3 +6,48 @@ DocTestSetup = quote end ``` +## Getting Started +### Installation +To use QuantumSavory, make sure you have Julia version 1.10 installed. You can download and install Julia from [the official Julia website](https://julialang.org/downloads/). + +Once Julia is setup, QuantumSavory can be installed with the following command in your in your Julia REPL: +```bash +$ julia +julia> ] +pkg> add QuantumSavory +``` +#### Optional Dependencies +There are optional packages that you need to install to use the full plotting feature. +- **Makie**: For plotting of registers and processes. +- **GeoMakie**: Enables plotting on a real-world map as a background. + +## Basic Demo +Here’s a simple example to demonstrate how you can set up a simulation to generate a set of registers with qubit slots. For more advanced examples and detailed guide, see[How-To Guides](@ref) and [Tutorials](@ref) sections. + + +``` +using QuantumSavory + +# This is a network of three registers, each with 2, 3, and 4 Qubit slots. +net = RegisterNet([Register(2), Register(3), Register(4)]) + +# initialize slots and entangle them +initialize!(net[1,1]) +initialize!(net[2,3], X₁) +initialize!((net[3,1],net[4,2]), X₁⊗Z₂) + +# apply CNOT gate +apply!((net[2,3],net[3,1]), CNOT) +``` + +If you have `Makie` and `GeoMakie` installed, you can plot the above network: +``` +using GLMakie +GLMakie.activate!() + +# generate background map +map_axis = generate_map() + +fig, ax, plt, obs = registernetplot_axis(map_axis, net, registercoords=[Point2f(-71, 42), Point2f(-111, 34), Point2f(-122, 37)]) +fig +``` \ No newline at end of file From d7ebad365f0f8291a79ffd4bfebf70b08615d252 Mon Sep 17 00:00:00 2001 From: hanakl Date: Tue, 10 Dec 2024 08:02:32 -0800 Subject: [PATCH 2/3] Update explanation --- docs/make.jl | 2 ++ docs/src/backendsimulator.md | 16 ++++++++++++++++ docs/src/howto/repeatergrid/repeatergrid.md | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 22ef6f8a..80e5fa61 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -30,6 +30,8 @@ function main() "Properties and Backgrounds" => "propbackgrounds.md", "Symbolic Expressions" => "symbolics.md", "Tagging and Querying" => "tag_query.md", + "Backend Simulatiors" => "backendsimulator.md", + "Discrete Event Simulator" => "discreteeventsimulator.md", "Visualizations" => "visualizations.md", ], "How-To Guides" => [ diff --git a/docs/src/backendsimulator.md b/docs/src/backendsimulator.md index e69de29b..887cca37 100644 --- a/docs/src/backendsimulator.md +++ b/docs/src/backendsimulator.md @@ -0,0 +1,16 @@ +# [Backend Simulators](@id backend) + +```@meta +DocTestSetup = quote + using QuantumSavory +end +``` +QuantumSavory supports two backend simulators: `QuantumClifford` and `QuantumOptics`. + +# QuantumClifford - Stabilizer Formalism + +QuantumClifford leverages stabilizer states and Clifford gates—highly structured operations that can be simulated more efficiently than arbitrary quantum processes. It uses the tableaux formalism with the destabilizer improvements, as implemented in the [`QuantumClifford`](https://qc.quantumsavory.org/stable/)library. Because these operations remain within the stabilizer subtheory, simulations can often run in polynomial time, enabling very fast computations. However, adding non-Clifford elements breaks this efficiency, making the simulation more complex and slower. + +# QuantumOptics - State Vector Formalism + +QuantumOptics uses a fully general state vector (wavefunction) representation. This approach, provided by the ['QuantumOptics'](https://qojulia.org/) library, can handle any quantum operation or state without the structural restrictions of stabilizer methods. While this generality is powerful, it quickly becomes computationally expensive as the number of qubits grows—memory and time requirements scale exponentially. Consequently, simulating large systems with the state vector formalism becomes impractically slow compared to stabilizer-based methods. \ No newline at end of file diff --git a/docs/src/howto/repeatergrid/repeatergrid.md b/docs/src/howto/repeatergrid/repeatergrid.md index 5f96d907..648aa076 100644 --- a/docs/src/howto/repeatergrid/repeatergrid.md +++ b/docs/src/howto/repeatergrid/repeatergrid.md @@ -49,7 +49,7 @@ The Swapper Protocol is initialized with a custom predicate function which is th This predicate function encodes most of the "logic" a local node will be performing. -The custom predicate function shown above is parametrized with `net` and `c_node` along with the keyword argument `low`, when initializing the Swapper Protocol. This predicate function `Int->Bool` selects the target remote nodes for which a swap is appropriate. The arguments are: +The custom predicate function shown above is parameterized with `net` and `c_node` along with the keyword argument `low`, when initializing the Swapper Protocol. This predicate function `Int->Bool` selects the target remote nodes for which a swap is appropriate. The arguments are: - `net`: The network of register nodes representing the graph structure, an instance of `RegisterNet`. From abf95df44b45065eafe5f8b707019df5a3ece00a Mon Sep 17 00:00:00 2001 From: Stefan Krastanov Date: Thu, 19 Dec 2024 13:17:54 -0500 Subject: [PATCH 3/3] mixed cleanup --- docs/make.jl | 2 +- docs/src/backendsimulator.md | 6 +++--- docs/src/discreteeventsimulator.md | 5 +++-- docs/src/manual.md | 6 +++++- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 80e5fa61..24f1d61e 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -30,7 +30,7 @@ function main() "Properties and Backgrounds" => "propbackgrounds.md", "Symbolic Expressions" => "symbolics.md", "Tagging and Querying" => "tag_query.md", - "Backend Simulatiors" => "backendsimulator.md", + "Backend Simulators" => "backendsimulator.md", "Discrete Event Simulator" => "discreteeventsimulator.md", "Visualizations" => "visualizations.md", ], diff --git a/docs/src/backendsimulator.md b/docs/src/backendsimulator.md index 887cca37..db02a5ed 100644 --- a/docs/src/backendsimulator.md +++ b/docs/src/backendsimulator.md @@ -5,12 +5,12 @@ DocTestSetup = quote using QuantumSavory end ``` -QuantumSavory supports two backend simulators: `QuantumClifford` and `QuantumOptics`. +The simulation of quantum dynamics in QuantumSavory can be done through many different backend simulators, depending on the tradeoff between performance and generality that the user needs. By default, it comes with two included simulators: `QuantumClifford` and `QuantumOptics`, but others can be plugged in through our universal quantum register interface. # QuantumClifford - Stabilizer Formalism -QuantumClifford leverages stabilizer states and Clifford gates—highly structured operations that can be simulated more efficiently than arbitrary quantum processes. It uses the tableaux formalism with the destabilizer improvements, as implemented in the [`QuantumClifford`](https://qc.quantumsavory.org/stable/)library. Because these operations remain within the stabilizer subtheory, simulations can often run in polynomial time, enabling very fast computations. However, adding non-Clifford elements breaks this efficiency, making the simulation more complex and slower. +QuantumClifford leverages stabilizer states and Clifford gates — highly structured operations that can be simulated more efficiently than arbitrary quantum processes. It uses the tableaux formalism with the destabilizer improvements, as implemented in the [`QuantumClifford`](https://qc.quantumsavory.org/stable/) library. Simulations run in polynomial time, enabling very fast computations. However, adding non-Clifford elements breaks this efficiency, making the simulation more complex and slower. # QuantumOptics - State Vector Formalism -QuantumOptics uses a fully general state vector (wavefunction) representation. This approach, provided by the ['QuantumOptics'](https://qojulia.org/) library, can handle any quantum operation or state without the structural restrictions of stabilizer methods. While this generality is powerful, it quickly becomes computationally expensive as the number of qubits grows—memory and time requirements scale exponentially. Consequently, simulating large systems with the state vector formalism becomes impractically slow compared to stabilizer-based methods. \ No newline at end of file +QuantumOptics uses a fully general state vector (wavefunction) representation. This approach, provided by the ['QuantumOptics'](https://qojulia.org/) library, can handle any quantum operation or state without the structural restrictions of stabilizer methods. While this generality is powerful, it quickly becomes computationally expensive as the number of qubits grows — memory and time requirements scale exponentially. Consequently, simulating large systems with the state vector formalism becomes impractically slow compared to stabilizer-based methods. \ No newline at end of file diff --git a/docs/src/discreteeventsimulator.md b/docs/src/discreteeventsimulator.md index 4eb8483d..f382ea12 100644 --- a/docs/src/discreteeventsimulator.md +++ b/docs/src/discreteeventsimulator.md @@ -8,9 +8,10 @@ end ## Overview -imulating quantum processes requires robust tools for **Discrete Event Simulator**. In QuantumSavory, we use `ConcurrentSim.jl` and `ResumableFunctions.jl` to model complex, asynchronous processes. +Simulating quantum processes requires robust tools for **Discrete Event Simulation**. In QuantumSavory, we use `ConcurrentSim.jl` and `ResumableFunctions.jl` to model complex, asynchronous processes. This simulation framework enables protocols to handle dynamic interactions, such as waiting for resources to become available. ### **ConcurrentSim.jl** and **ResumableFunctions.jl** -QuantumSavory simulations are structured using [`ConcurrentSim.jl`](https://github.com/JuliaDynamics/ConcurrentSim.jl). A process is defined as a `@resumable` function that yields events, allowing for efficient resource allocation and the expression of protocols that pause until specific conditions are met. These features are essential for implementing waiting mechanisms, such as waiting for messages or changes in a quantum state. + +QuantumSavory discrete event simulations are based on [`ConcurrentSim.jl`](https://github.com/JuliaDynamics/ConcurrentSim.jl). A process is defined as a `@resumable` function that yields events, allowing for efficient resource allocation and the expression of protocols that pause until specific conditions are met. These features are essential for implementing waiting mechanisms, such as waiting for messages or changes in a quantum state. diff --git a/docs/src/manual.md b/docs/src/manual.md index 3f86d0bd..1ea5d1ae 100644 --- a/docs/src/manual.md +++ b/docs/src/manual.md @@ -7,7 +7,9 @@ end ``` ## Getting Started + ### Installation + To use QuantumSavory, make sure you have Julia version 1.10 installed. You can download and install Julia from [the official Julia website](https://julialang.org/downloads/). Once Julia is setup, QuantumSavory can be installed with the following command in your in your Julia REPL: @@ -16,14 +18,16 @@ $ julia julia> ] pkg> add QuantumSavory ``` + #### Optional Dependencies + There are optional packages that you need to install to use the full plotting feature. - **Makie**: For plotting of registers and processes. - **GeoMakie**: Enables plotting on a real-world map as a background. ## Basic Demo -Here’s a simple example to demonstrate how you can set up a simulation to generate a set of registers with qubit slots. For more advanced examples and detailed guide, see[How-To Guides](@ref) and [Tutorials](@ref) sections. +Here’s a simple example to demonstrate how you can set up a simulation to generate a set of registers with qubit slots. For more advanced examples and detailed guide, see[How-To Guides](@ref) and [Tutorials](@ref) sections. ``` using QuantumSavory