From ffc06c7348b62c4c2e52b66f04edeed66980180a Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Mon, 18 Mar 2024 19:18:04 +0000 Subject: [PATCH] build based on 8191d46 --- dev/.documenter-siteinfo.json | 2 +- dev/api/algorithms/index.html | 2 +- dev/api/circuit/index.html | 2 +- dev/api/gates/index.html | 2 +- dev/ecosystem/index.html | 2 +- dev/index.html | 2 +- dev/objects.inv | Bin 731 -> 731 bytes 7 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index b51e7af..664e1de 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-03-18T19:16:42","documenter_version":"1.3.0"}} \ No newline at end of file +{"documenter":{"julia_version":"1.10.2","generation_timestamp":"2024-03-18T19:18:01","documenter_version":"1.3.0"}} \ No newline at end of file diff --git a/dev/api/algorithms/index.html b/dev/api/algorithms/index.html index d16fb71..866aba0 100644 --- a/dev/api/algorithms/index.html +++ b/dev/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/dev/api/circuit/index.html b/dev/api/circuit/index.html index c9bc679..19066b9 100644 --- a/dev/api/circuit/index.html +++ b/dev/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/dev/api/gates/index.html b/dev/api/gates/index.html index 4bcee4f..05da621 100644 --- a/dev/api/gates/index.html +++ b/dev/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/dev/ecosystem/index.html b/dev/ecosystem/index.html index 973e6a5..7246524 100644 --- a/dev/ecosystem/index.html +++ b/dev/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/dev/index.html b/dev/index.html index 7a29d09..cb49163 100644 --- a/dev/index.html +++ b/dev/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

diff --git a/dev/objects.inv b/dev/objects.inv index 6e2f3cd62fa570a7e14a35a2d2fcb73829ea4fb3..a10036c029e7c196c45d5386ef09532bcdd0def2 100644 GIT binary patch delta 12 Tcmcc3dYg5E4Wsc!+j&d?A0z}% delta 12 Tcmcc3dYg5E4WrRU+j&d?A0Grx