From 9ece0bf87889459543cc0df34369718e73a208bd Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Thu, 26 Sep 2024 14:12:38 +0000 Subject: [PATCH] build based on 4889aab --- previews/PR52/.documenter-siteinfo.json | 2 +- previews/PR52/api/algorithms/index.html | 2 +- previews/PR52/api/circuit/index.html | 2 +- previews/PR52/api/gates/index.html | 2 +- previews/PR52/ecosystem/index.html | 2 +- previews/PR52/index.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/previews/PR52/.documenter-siteinfo.json b/previews/PR52/.documenter-siteinfo.json index 6d48f85..3e9850e 100644 --- a/previews/PR52/.documenter-siteinfo.json +++ b/previews/PR52/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-26T14:11:53","documenter_version":"1.7.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.5","generation_timestamp":"2024-09-26T14:12:34","documenter_version":"1.7.0"}} \ No newline at end of file diff --git a/previews/PR52/api/algorithms/index.html b/previews/PR52/api/algorithms/index.html index 9f5d308..9bdc191 100644 --- a/previews/PR52/api/algorithms/index.html +++ b/previews/PR52/api/algorithms/index.html @@ -1,2 +1,2 @@ -Algorithms · Quac

Algorithms

Quac.Algorithms.QuantumVolumeFunction
QuantumVolume(n, depth)

Generate a Quantum Volume circuit of n qubits and depth layers. See [1] for more details.

References

[1] Cross, Andrew W., et al. "Validating quantum computers using randomized model circuits." Physical Review A 100.3 (2019): 032328.

source
+Algorithms · Quac

Algorithms

Quac.Algorithms.QuantumVolumeFunction
QuantumVolume(n, depth)

Generate a Quantum Volume circuit of n qubits and depth layers. See [1] for more details.

References

[1] Cross, Andrew W., et al. "Validating quantum computers using randomized model circuits." Physical Review A 100.3 (2019): 032328.

source
diff --git a/previews/PR52/api/circuit/index.html b/previews/PR52/api/circuit/index.html index ee852e3..4547071 100644 --- a/previews/PR52/api/circuit/index.html +++ b/previews/PR52/api/circuit/index.html @@ -1,2 +1,2 @@ -Circuit · Quac

Circuit

Quantum circuits can be seen as DAGs (Direct Acyclic Graphs) in which the width of the DAG is constant and equal to the number of qubits. Also the indgree and outdegree of quantum gates must always be equal. But many state-of-art quantum circuit libraries use either (a) lists of moments of gates or (b) graphs for representing them, which do not exploit the sparsity of the circuit or already make decisions about their layout (thus not having a layout-independent representation).

Instead Quac uses multi-priority queues to store gates: there is a queue per qubit lane that stores the gates that act on it, and priorities are the order in which they are applied. If a gate acts on multiple qubits, it will contain a priority per qubit. This data structure allows us to store gates in the most compact way while iterating on gates, reversing the circuit, ... are still efficient. It appears to be the perfect data structure for quantum circuits.

Was this really necessary?

No, the bottleneck of quantum circuits is not on their representation but when reading the source code of other quantum circuit libraries, I wasn't convinced by their solutions: graphs, already laid out lists of lists, a serialized list of gates, ... So I came up with multi-priority queues which seem like the perfect fit and as a consequence, the implementation is simple yet efficient.

Quac.CircuitType

A quantum circuit implementation using multi-priority queues.

  • Queues are gate-buffers in qubit lanes.
  • Multi-priority numbers can be retrieved procedurally from gate-lanes encoded inside the gates of the queues.
source

Methods

Base.adjointMethod
Base.adjoint(circuit)

Retrieve the adjoint circuit which fulfills the following equality.

circuit * circuit' == I(n)

Notes

If all gates are hermitian, then the following equality also holds.

circuit * circuit' == circuit' * circuit == I(n)
source
Base.hcatMethod
hcat(circuits::Circuit...)

Join circuits in the temporal dimension.

source
Base.iterateMethod
Base.iterate(circuit::Circuit[, state])

Retrieves next gate from state by travelling through a topologically sorted path.

Arguments

  • circuit::Circuit
  • state (or head) should be a NTuple{N, Int} where N is the number of lanes. Each element is a pointer to the next gate on each lane.
source
Base.push!Method
push!(circuit, gate...)

Appends a gate to the circuit.

source
Base.vcatMethod
vcat(circuits::Circuit...)

Join circuits in the spatial dimension.

source
Quac.connectivityFunction
connectivity([f,] circuit)

Generate connectivity graph between qubits.

Arguments

  • f: Function to filter gates from circuit.
  • circuit: Circuit.
source
Quac.lanesMethod
lanes(circuit)

Return the number of qubit lanes in a circuit.

source
Quac.momentsFunction
moments(circuit)

Return moments (lists of gates that can execute at the same time) of the circuit.

source
+Circuit · Quac

Circuit

Quantum circuits can be seen as DAGs (Direct Acyclic Graphs) in which the width of the DAG is constant and equal to the number of qubits. Also the indgree and outdegree of quantum gates must always be equal. But many state-of-art quantum circuit libraries use either (a) lists of moments of gates or (b) graphs for representing them, which do not exploit the sparsity of the circuit or already make decisions about their layout (thus not having a layout-independent representation).

Instead Quac uses multi-priority queues to store gates: there is a queue per qubit lane that stores the gates that act on it, and priorities are the order in which they are applied. If a gate acts on multiple qubits, it will contain a priority per qubit. This data structure allows us to store gates in the most compact way while iterating on gates, reversing the circuit, ... are still efficient. It appears to be the perfect data structure for quantum circuits.

Was this really necessary?

No, the bottleneck of quantum circuits is not on their representation but when reading the source code of other quantum circuit libraries, I wasn't convinced by their solutions: graphs, already laid out lists of lists, a serialized list of gates, ... So I came up with multi-priority queues which seem like the perfect fit and as a consequence, the implementation is simple yet efficient.

Quac.CircuitType

A quantum circuit implementation using multi-priority queues.

  • Queues are gate-buffers in qubit lanes.
  • Multi-priority numbers can be retrieved procedurally from gate-lanes encoded inside the gates of the queues.
source

Methods

Base.adjointMethod
Base.adjoint(circuit)

Retrieve the adjoint circuit which fulfills the following equality.

circuit * circuit' == I(n)

Notes

If all gates are hermitian, then the following equality also holds.

circuit * circuit' == circuit' * circuit == I(n)
source
Base.hcatMethod
hcat(circuits::Circuit...)

Join circuits in the temporal dimension.

source
Base.iterateMethod
Base.iterate(circuit::Circuit[, state])

Retrieves next gate from state by travelling through a topologically sorted path.

Arguments

  • circuit::Circuit
  • state (or head) should be a NTuple{N, Int} where N is the number of lanes. Each element is a pointer to the next gate on each lane.
source
Base.push!Method
push!(circuit, gate...)

Appends a gate to the circuit.

source
Base.vcatMethod
vcat(circuits::Circuit...)

Join circuits in the spatial dimension.

source
Quac.connectivityFunction
connectivity([f,] circuit)

Generate connectivity graph between qubits.

Arguments

  • f: Function to filter gates from circuit.
  • circuit: Circuit.
source
Quac.lanesMethod
lanes(circuit)

Return the number of qubit lanes in a circuit.

source
Quac.momentsFunction
moments(circuit)

Return moments (lists of gates that can execute at the same time) of the circuit.

source
diff --git a/previews/PR52/api/gates/index.html b/previews/PR52/api/gates/index.html index 03501ae..eebabff 100644 --- a/previews/PR52/api/gates/index.html +++ b/previews/PR52/api/gates/index.html @@ -9,4 +9,4 @@ 0 -1

Furthermore, the $Z$ gate allows a Diagonal representation!

julia> Diagonal{Float32}(gate)
 2×2 Diagonal{Float32, Vector{Float32}}:
  1.0    ⋅
-  ⋅   -1.0
Quac.OperatorType
Operator

An abstract type that groups all symbolic expressions of operators.

source
Quac.GateType
Gate{Op,N}

A type that represents an Operator acting on N qubits.

source

Pauli gates

Quac.IType
I(lane)

The $σ_0$ Pauli matrix gate.

Note

Due to name clashes with LinearAlgebra.I, Quac.I is not exported by default.

source
Quac.XType
X(lane)

The $σ_1$ Pauli matrix gate.

source
Quac.YType
Y(lane)

The $σ_2$ Pauli matrix gate.

source
Quac.ZType
Z(lane)

The $σ_3$ Pauli matrix gate.

source

Hadamard gate

Quac.HType
H(lane)

The Hadamard gate.

source

Phase gates

Quac.SType
S(lane)

The $S$ gate or $\frac{π}{2}$ rotation around Z-axis.

source
Quac.SdType
Sd(lane)

The $S^\dagger$ gate or $-\frac{π}{2}$ rotation around Z-axis.

source
Quac.TType
T(lane)

The $T$ gate or $\frac{π}{4}$ rotation around Z-axis.

source
Quac.TdType
Td(lane)

The $T^\dagger$ gate or $-\frac{π}{4}$ rotation around Z-axis.

source

Rotation gates

Quac.RxType
Rx(lane, θ)

The $\theta$ rotation around the X-axis gate.

source
Quac.RyType
Ry(lane, θ)

The $\theta$ rotation around the Y-axis gate.

source
Quac.RzType
Rz(lane, θ)

The $\theta$ rotation around the Z-axis gate.

Notes

  • The U1 gate is an alias of Rz.
source
Quac.RxxType
Rxx(lane1, lane2, θ)

The $\theta$ rotation around the XX-axis gate.

source
Quac.RyyType
Ryy(lane1, lane2, θ)

The $\theta$ rotation around the YY-axis gate.

source
Quac.RzzType
Rzz(lane1, lane2, θ)

The $\theta$ rotation around the ZZ-axis gate.

source

General U2, U3 gates

Quac.U2Type
U2(lane, ϕ, λ)

The $U2$ gate.

source
Quac.U3Type
U3(lane, θ, ϕ, λ)

The $U3$ gate.

source

Controlled gates

Quac.ControlType
Control(lane, op::Gate)

A controlled gate.

source

SWAP gate

Quac.SwapType
Swap(lane1, lane2)

The SWAP gate.

source

Special Unitary gate

Experimental interface

This interface is experimental and may change in the future.

Quac.SUType
SU{N}(lane_1, lane_2, ..., lane_N, array)

The SU{N} multi-qubit general unitary gate that can be used to represent any unitary matrix that acts on N qubits. A new random SU{N} can be created with rand(SU{N}, lanes...), where N is the dimension of the unitary matrix and lanes are the qubit lanes on which the gate acts.

Note

Unlike the general notation, N is not the dimension of the unitary matrix, but the number of qubits on which it acts. The dimension of the unitary matrix is $2^N \times 2^N$.

source
+ ⋅ -1.0
Quac.OperatorType
Operator

An abstract type that groups all symbolic expressions of operators.

source
Quac.GateType
Gate{Op,N}

A type that represents an Operator acting on N qubits.

source

Pauli gates

Quac.IType
I(lane)

The $σ_0$ Pauli matrix gate.

Note

Due to name clashes with LinearAlgebra.I, Quac.I is not exported by default.

source
Quac.XType
X(lane)

The $σ_1$ Pauli matrix gate.

source
Quac.YType
Y(lane)

The $σ_2$ Pauli matrix gate.

source
Quac.ZType
Z(lane)

The $σ_3$ Pauli matrix gate.

source

Hadamard gate

Quac.HType
H(lane)

The Hadamard gate.

source

Phase gates

Quac.SType
S(lane)

The $S$ gate or $\frac{π}{2}$ rotation around Z-axis.

source
Quac.SdType
Sd(lane)

The $S^\dagger$ gate or $-\frac{π}{2}$ rotation around Z-axis.

source
Quac.TType
T(lane)

The $T$ gate or $\frac{π}{4}$ rotation around Z-axis.

source
Quac.TdType
Td(lane)

The $T^\dagger$ gate or $-\frac{π}{4}$ rotation around Z-axis.

source

Rotation gates

Quac.RxType
Rx(lane, θ)

The $\theta$ rotation around the X-axis gate.

source
Quac.RyType
Ry(lane, θ)

The $\theta$ rotation around the Y-axis gate.

source
Quac.RzType
Rz(lane, θ)

The $\theta$ rotation around the Z-axis gate.

Notes

  • The U1 gate is an alias of Rz.
source
Quac.RxxType
Rxx(lane1, lane2, θ)

The $\theta$ rotation around the XX-axis gate.

source
Quac.RyyType
Ryy(lane1, lane2, θ)

The $\theta$ rotation around the YY-axis gate.

source
Quac.RzzType
Rzz(lane1, lane2, θ)

The $\theta$ rotation around the ZZ-axis gate.

source

General U2, U3 gates

Quac.U2Type
U2(lane, ϕ, λ)

The $U2$ gate.

source
Quac.U3Type
U3(lane, θ, ϕ, λ)

The $U3$ gate.

source

Controlled gates

Quac.ControlType
Control(lane, op::Gate)

A controlled gate.

source

SWAP gate

Quac.SwapType
Swap(lane1, lane2)

The SWAP gate.

source

Special Unitary gate

Experimental interface

This interface is experimental and may change in the future.

Quac.SUType
SU{N}(lane_1, lane_2, ..., lane_N, array)

The SU{N} multi-qubit general unitary gate that can be used to represent any unitary matrix that acts on N qubits. A new random SU{N} can be created with rand(SU{N}, lanes...), where N is the dimension of the unitary matrix and lanes are the qubit lanes on which the gate acts.

Note

Unlike the general notation, N is not the dimension of the unitary matrix, but the number of qubits on which it acts. The dimension of the unitary matrix is $2^N \times 2^N$.

source
diff --git a/previews/PR52/ecosystem/index.html b/previews/PR52/ecosystem/index.html index d26ab81..9616cbd 100644 --- a/previews/PR52/ecosystem/index.html +++ b/previews/PR52/ecosystem/index.html @@ -1,2 +1,2 @@ -Ecosystem · Quac

Ecosystem

Tenet

Tenet is a Tensor Network library focused on expressibility, flexibility and speed. It leverages Julia's multiple dispatch and parametric typing to specialize functions depending on the ansatz (MPS, PEPS, ...) such as contraction path search, tensor contraction, ...

Gato

Gato is a Statevector (aka Schrödinger-like) simulator.

+Ecosystem · Quac

Ecosystem

Tenet

Tenet is a Tensor Network library focused on expressibility, flexibility and speed. It leverages Julia's multiple dispatch and parametric typing to specialize functions depending on the ansatz (MPS, PEPS, ...) such as contraction path search, tensor contraction, ...

Gato

Gato is a Statevector (aka Schrödinger-like) simulator.

diff --git a/previews/PR52/index.html b/previews/PR52/index.html index aa5092f..2ec1649 100644 --- a/previews/PR52/index.html +++ b/previews/PR52/index.html @@ -1,2 +1,2 @@ -Home · Quac

Quac.jl

Quac stands for Quantum circuits and it's a library for quantum circuit representation in Julia. It serves as the core library of multiple libraries related to quantum computing: simulators, hardware controllers, ...

Quac is not a simulator or a controller, but it provides the tools to build them.

Features

  • Multiple representation of gates Gates are symbolic in Quac, and thanks to Julia's multiple-dispatch, they posess multiple representations like dense arrays, diagonal matrices, ...
  • (New) compact and efficient description of circuits Unlike other libraries, Quac uses multi-priority queues as the underlying data-structure.
  • SVG rendering of quantum circuits

"4-qubit Quantum Fourier Transform"

  • Extensibility Every part of the package is extensible with new types or functionality as you wish.

Contents

+Home · Quac

Quac.jl

Quac stands for Quantum circuits and it's a library for quantum circuit representation in Julia. It serves as the core library of multiple libraries related to quantum computing: simulators, hardware controllers, ...

Quac is not a simulator or a controller, but it provides the tools to build them.

Features

  • Multiple representation of gates Gates are symbolic in Quac, and thanks to Julia's multiple-dispatch, they posess multiple representations like dense arrays, diagonal matrices, ...
  • (New) compact and efficient description of circuits Unlike other libraries, Quac uses multi-priority queues as the underlying data-structure.
  • SVG rendering of quantum circuits

"4-qubit Quantum Fourier Transform"

  • Extensibility Every part of the package is extensible with new types or functionality as you wish.

Contents