Snowflurry

From Alliance Doc
Revision as of 20:20, 30 September 2024 by Diane27 (talk | contribs) (Created page with "== Use case: Bell states == Bell states are maximally entangled two-qubit states. They are simple examples of two quantum phenomena: superposition and entanglement. The library [https://github.com/SnowflurrySDK/Snowflurry.jl/ Snowflurry] allows to construct the first Bell state as follows. <noinclude> {{Command|julia |result=julia> using Snowflurry julia> circuit=QuantumCircuit(qubit_count=2); julia> push!(circuit,hadamard(1)); julia> push!(circuit,control_x(1,2)); julia...")
Jump to navigation Jump to search
Other languages:

Snowflurry

Developed in Julia by Anyon Systems, Snowflurry is an open-source quantum computing library to build, simulate and run quantum circuits. A related library called SnowflurryPlots allows you to visualize simulation results in a bar graph. Useful to explore quantum computing, its features are described in the documentation and the installation guide is available on the GitHub page. Like the PennyLane library, Snowflurry can be used to run quantum circuits on the MonarQ quantum computer.

Installation

Use case: Bell states

Bell states are maximally entangled two-qubit states. They are simple examples of two quantum phenomena: superposition and entanglement. The library Snowflurry allows to construct the first Bell state as follows.

Question.png
[name@server ~]$ julia
julia> using Snowflurry
julia> circuit=QuantumCircuit(qubit_count=2);
julia> push!(circuit,hadamard(1));
julia> push!(circuit,control_x(1,2));
julia> print(circuit)

<div lang="fr" dir="ltr" class="mw-content-ltr">
Quantum Circuit Object:
   qubit_count: 2 
q[1]:──H────*──
            ¦ 
q[2]:───────X──

Dans la section de code ci-dessus, la porte de Hadamard crée une superposition égale de |0⟩ et |1⟩ sur le premier qubit tandis que la porte CNOT (porte X controllée) crée une intrication entre les deux qubits. On retrouve une superposition égale des états |00⟩ et |11⟩, soit le premier état de Bell. La fonction simulate permet de simuler l'état exact du système.

 julia> state = simulate(circuit)
 julia> print(state)   
 4-element Ket{ComplexF64}:
 0.7071067811865475 + 0.0im
 0.0 + 0.0im
 0.0 + 0.0im
 0.7071067811865475 + 0.0im

Pour effectuer une mesure, l'opération readout permet de spécifier quels qubits seront mesurés. La bibliothèque SnowflurryPlots et la fonction plot_histogram permettent de visualiser les résultats.

Question.png
[name@server ~]$ julia
julia> using SnowflurryPlots
julia> push!(circuit, readout(1,1), readout(2,2))
julia> plot_histogram(circuit,1000)
Résultats de 1000 simulations de l'état de Bell.