Robust Blind Verification

Package documentation

Docs for package

RobustBlindVerification.c_iteratorMethod
c_iterator(N)

Create a circular iterator that generates numbers from 0 to `N-1`.

# Arguments
- `N`: The upper limit for the circular iterator.

# Returns
A circular iterator that generates numbers from 0 to `N-1`.

# Examples
```julia
# Create a circular iterator
N = 5
iterator = c_iterator(N)
```
source
RobustBlindVerification.c_shift_indexMethod
c_shift_index(n::Int)

Compute the shifted index `n-1` for circular indexing.

# Arguments
- `n::Int`: The input index.

# Returns
The shifted index `n-1` for circular indexing.

# Examples
```julia
# Compute the shifted index
n = 3
shifted_index = c_shift_index(n)
```
source
RobustBlindVerification.get_edge_iteratorMethod
get_edge_iterator(resource::MBQCResourceState)

Retrieve an iterator over the edges in an MBQC resource state.

# Arguments
- `resource::MBQCResourceState`: An MBQC resource state containing the graph representation of the resource.

# Returns
An iterator over the edges of the resource state's graph.

# Examples
```julia
# Create an MBQC resource state
graph = MBQCGraph(...)
flow = MBQCFlow(...)
angles = MBQCAngles(...)
resource = MBQCResourceState(graph, flow, angles)

# Get the edge iterator
edge_iterator = get_edge_iterator(resource)
```
source
RobustBlindVerification.get_number_verticesMethod
get_number_qubits(resource::MBQCResourceState)

Retrieve the number of qubits in an MBQC resource state.

# Arguments
- `resource::MBQCResourceState`: An MBQC resource state containing the graph representation of the resource.

# Returns
The number of qubits in the resource state.

# Examples
```julia
# Create an MBQC resource state
graph = MBQCGraph(...)
flow = MBQCFlow(...)
angles = MBQCAngles(...)
resource = MBQCResourceState(graph, flow, angles)

# Get the number of qubits
num_qubits = get_number_qubits(resource)
```
source
RobustBlindVerification.get_vertex_iteratorMethod
get_vertex_iterator(resource::MBQCResourceState)

Retrieve an iterator over the vertices in an MBQC resource state.

# Arguments
- `resource::MBQCResourceState`: An MBQC resource state containing the graph representation of the resource.

# Returns
An iterator over the vertices of the resource state's graph.

# Examples
```julia
# Create an MBQC resource state
graph = MBQCGraph(...)
flow = MBQCFlow(...)
angles = MBQCAngles(...)
resource = MBQCResourceState(graph, flow, angles)

# Get the vertex iterator
vertex_iterator = get_vertex_iterator(resource)
```
source
RobustBlindVerification.get_vertex_neighboursMethod
get_vertex_neighbours(resource::MBQCResourceState, vertex)

Retrieve the neighbors of a given vertex in an MBQC resource state.

# Arguments
- `resource::MBQCResourceState`: An MBQC resource state containing the graph representation of the resource.
- `vertex`: The vertex for which to retrieve the neighbors.

# Returns
An array of vertices representing the neighbors of the specified vertex.

# Examples
```julia
# Create an MBQC resource state
graph = MBQCGraph(...)
flow = MBQCFlow(...)
angles = MBQCAngles(...)
resource = MBQCResourceState(graph, flow, angles)

# Get the neighbors of a vertex
vertex = 1
neighbors = get_vertex_neighbours(resource, vertex)
```
source
RobustBlindVerification.init_plus_phase_state!Method
plusState(qureg, qᵢ)

Applies a Hadamard gate (|+⟩) to the specified qubit.

# Arguments
- `qureg`: State vector or density matrix.
- `qᵢ`: Qubit index to which the Hadamard gate is applied. Index must be 1-based, as `c_shift_index` is called.
source
RobustBlindVerification.init_plus_phase_state!Method

initplusphase_state!(qureg,qᵢ,φᵢ)

Applies a Hadamard gate (|+⟩) then a phase rotation gate (|+_ϕ⟩)
- ψ: State vector or density matrix
- qᵢ: Qubit to be applied gates to, index must be 1 based as c_shift_index is called.
- φᵢ: Angle for phase shift
source
RobustBlindVerification.ClusterStateType
ClusterState

A struct representing the cluster state in the MBQC framework.

# Description
`ClusterState` is a marker struct used to represent the cluster state in an MBQC computation. It can be used in combination with other data structures or algorithms specific to the cluster state model.

# Example
```julia
# Declare cluster state
cluster_state = ClusterState()
```
source
RobustBlindVerification.InputQubitsType
InputQubits

A struct representing input qubits in the MBQC framework.

# Description
`InputQubits` is a marker struct used to indicate the presence of input qubits in an MBQC computation. It is typically used in combination with other data structures or algorithms to handle input qubits in the computation.

# Example
```julia
# Declare input qubits
input_qubits = InputQubits()
```
source
RobustBlindVerification.MBQCAnglesType
MBQCAngles(angles) 

- Struct representing the angles associated to the graph. The number of angles will be the same as the vertices in the graph.

# Parameters
- `angles`: A listed set of values, as long as the angles are indexable in the same ways that the vertices are.

# Example
```
julia> angles = [π,π/4,5π/4,7π/4]
julia> mbqc_angles = MBQCAngles(angles) 
```
source
RobustBlindVerification.MBQCFlowType
MBQCFlow(forward_flow, backward_flow)

Struct representing flow in MBQC.

# Definition of Flow
- `forward_flow`, `f`: Oᶜ → Iᶜ is a mapping `v ↦ f(v)` with an inverse `f⁻¹(v) ↦ v`, with partial order "≤". The partial order is said to map the present to the future or the present to the past.
- (a) `v ∼ f(v)`, where "∼" defines the neighbourhood `N(f(v))` and `v` has set membership.
- (b) `v ≤ f(v)`
- (c) `w ∼ f(v)`, then ∀ `v`, `v ≤ w`

## Example
- One dimensional lattice, the "path graph", where a vertex is represented as "()" and an edge is represented as "---".
- Let `i` be the index of each vertex so that `i = {1, 2, 3, 4}` and
- `p := (1)---(2)---(3)---(4)`
- `f(i) := i + 1`
- `f⁻¹(i) := i - 1`
- `f([1, 2, 3]) = [2, 3, 4]`, since 4 has no future, there is no 4 + 1 answer.
- `f⁻¹([2, 3, 4]) = [1, 2, 3]`, since 1 has no past, there is no 1 - 1 answer.

# Parameters
- `forward_flow`: A mapping to take an input vertex and return the output vertex such that the definitions of flow hold. The forward flow function can be any container that takes a vertex index as input and outputs a new vertex index.
- `backward_flow`: A mapping to take an output vertex and return the input vertex. The backward flow function maps the inverse of the forward flow.

# Example
```julia
# Define forward and backward flow functions
forward_flow(io) = io[2]
backward_flow(io) = io[1]

# Create an MBQCFlow
mbqc_flow = MBQCFlow(forward_flow, backward_flow)
```
source
RobustBlindVerification.MBQCGraphType
MBQCGraph(graph,input,output)

- Struct representing the graph used in the MBQC. Container holds the graph as well as the input and output sets.

# Parameters
- `graph`: Any graph suitable for MBQC
- `input`: has type MBQCInput
- `output`: had type MBQCOutput

# Example
```
julia> using Graphs # use using Pkg; Pkg.add("Graphs") is not installede
julia> graph = Graphs.grid([1,4]) # 1D cluster graph (path graph) on 4 vertices
julia> indices,values = (1),(0)
julia> input  = MBQCInput(indices,values)
julia> indices = (4)
julia> output  = MBQCOutput(indices)
julia> mbqc_graph = MBQCGraph(graph,input,output)
```
source
RobustBlindVerification.MBQCInputType
MBQCInput(indices,values)

- Struct representing an input set into the graph, can be empty

# Parameters
- `indices`: has type Tuple on normally integers (whole numbers 1 to N) and correspond to vertices in a graph.
- `values`: has type Tuple, can be any type

# Example
```
julia> indices = (1,2,3,4)
julia> values = (0,1,1,0) #Computational basis outcomes
julia> mbqc_input = MBQCInput(indices,values)
```
source
RobustBlindVerification.MBQCMeasurementOutcomesType
MBQCMeasurementOutcomes(outcomes)

Struct representing measurement outcomes in MBQC.

# Parameter
- `outcomes`: An array or container representing the measurement outcomes.

## Example
```julia
# Define measurement outcomes
outcomes = [0, 1, 1, 0]

# Create an MBQCMeasurementOutcomes
measurement_outcomes = MBQCMeasurementOutcomes(outcomes)
```
source
RobustBlindVerification.MBQCOutputType
MBQCOutput(indices)

- Struct representing an output set into the graph, can be empty.

# Parameters
- `indices`: has type Tuple on normally integers (whole numbers 1 to N) and correspond to the vertices in a graph.


# Example
```
julia> indices = (10,11,12)
julia> mbqc_output = MBQCOutput(indices)
```
source
RobustBlindVerification.MBQCResourceStateType
MBQCResourceState(graph, flow, angles)

Struct representing a resource state in MBQC.

# Parameters
- `graph`: An instance of `MBQCGraph` representing the underlying graph structure.
- `flow`: An instance of `MBQCFlow` representing the flow in the resource state.
- `angles`: An instance of `MBQCAngles` representing the angles associated with each vertex.

## Example
```julia
# Create an MBQCGraph
graph = MBQCGraph([1, 2, 3], [(1, 2), (2, 3)])

# Create an MBQCFlow
flow = MBQCFlow((1, 2) => 2, (2, 3) => 3)

# Create an MBQCAngles
angles = MBQCAngles([π/2, π/4, π/3])

# Create an MBQCResourceState
resource_state = MBQCResourceState(graph, flow, angles)
```
source
RobustBlindVerification.NoInputQubitsType
NoInputQubits

A struct representing the absence of input qubits in the MBQC framework.

# Description
`NoInputQubits` is a marker struct used to indicate the absence of input qubits in an MBQC computation. It can be used as a flag or placeholder to handle scenarios where there are no input qubits in the computation.

# Example
```julia
# Declare absence of input qubits
no_input_qubits = NoInputQubits()
```
source