qsim::BasicGateFuser

#include <fuser_basic.h>

Stateless object with methods for aggregating Gates into GateFused.

Summary

Measurement gates with equal times are fused together. User-defined controlled gates (controlled_by.size() > 0) and gates acting on more than two qubits are not fused. The template parameter Gate can be Gate type or a pointer to Gate type.

Public types

GateFused using
qsim::GateFused< RGate >

Public static functions

FuseGates(const Parameter & param, unsigned num_qubits, const std::vector< Gate > & gates)
std::vector< GateFused >
Stores ordered sets of gates, each acting on two qubits, that can be applied together.
FuseGates(const Parameter & param, unsigned num_qubits, const std::vector< Gate > & gates, const std::vector< unsigned > & times_to_split_at)
std::vector< GateFused >
Stores ordered sets of gates, each acting on two qubits, that can be applied together.
FuseGates(const Parameter & param, unsigned num_qubits, typename std::vector< Gate >::const_iterator gfirst, typename std::vector< Gate >::const_iterator glast)
std::vector< GateFused >
Stores ordered sets of gates, each acting on two qubits, that can be applied together.
FuseGates(const Parameter & param, unsigned num_qubits, typename std::vector< Gate >::const_iterator gfirst, typename std::vector< Gate >::const_iterator glast, const std::vector< unsigned > & times_to_split_at)
std::vector< GateFused >
Stores ordered sets of gates, each acting on two qubits, that can be applied together.

Structs

qsim::BasicGateFuser::Parameter

User-specified parameters for gate fusion.

Public types

GateFused

qsim::GateFused< RGate > qsim::BasicGateFuser::GateFused

Public static functions

FuseGates

std::vector< GateFused > qsim::BasicGateFuser::FuseGates(
  const Parameter & param,
  unsigned num_qubits,
  const std::vector< Gate > & gates
)

Stores ordered sets of gates, each acting on two qubits, that can be applied together.

Note that gates fused with this method are not multiplied together until ApplyFusedGate is called on the output. To respect specific time boundaries while fusing gates, use the other version of this method below.

Details
Parameters
param
Options for gate fusion.
num_qubits
The number of qubits acted on by 'gates'.
gates
The gates (or pointers to the gates) to be fused. Gate times should be ordered.
Returns
A vector of fused gate objects. Each element is a set of gates acting on a specific pair of qubits which can be applied as a group.

FuseGates

std::vector< GateFused > qsim::BasicGateFuser::FuseGates(
  const Parameter & param,
  unsigned num_qubits,
  const std::vector< Gate > & gates,
  const std::vector< unsigned > & times_to_split_at
)

Stores ordered sets of gates, each acting on two qubits, that can be applied together.

Note that gates fused with this method are not multiplied together until ApplyFusedGate is called on the output.

Details
Parameters
param
Options for gate fusion.
num_qubits
The number of qubits acted on by 'gates'.
gates
The gates (or pointers to the gates) to be fused. Gate times should be ordered.
times_to_split_at
Ordered list of time steps at which to separate fused gates. Each element of the output will contain gates from a single 'window' in this list.
Returns
A vector of fused gate objects. Each element is a set of gates acting on a specific pair of qubits which can be applied as a group.

FuseGates

std::vector< GateFused > qsim::BasicGateFuser::FuseGates(
  const Parameter & param,
  unsigned num_qubits,
  typename std::vector< Gate >::const_iterator gfirst,
  typename std::vector< Gate >::const_iterator glast
)

Stores ordered sets of gates, each acting on two qubits, that can be applied together.

Note that gates fused with this method are not multiplied together until ApplyFusedGate is called on the output. To respect specific time boundaries while fusing gates, use the other version of this method below.

Details
Parameters
param
Options for gate fusion.
num_qubits
The number of qubits acted on by gates.
gfirst glast
The iterator range [gfirst, glast) to fuse gates (or pointers to gates) in. Gate times should be ordered.
Returns
A vector of fused gate objects. Each element is a set of gates acting on a specific pair of qubits which can be applied as a group.

FuseGates

std::vector< GateFused > qsim::BasicGateFuser::FuseGates(
  const Parameter & param,
  unsigned num_qubits,
  typename std::vector< Gate >::const_iterator gfirst,
  typename std::vector< Gate >::const_iterator glast,
  const std::vector< unsigned > & times_to_split_at
)

Stores ordered sets of gates, each acting on two qubits, that can be applied together.

Note that gates fused with this method are not multiplied together until ApplyFusedGate is called on the output.

Details
Parameters
param
Options for gate fusion.
num_qubits
The number of qubits acted on by gates.
gfirst glast
The iterator range [gfirst, glast) to fuse gates (or pointers to gates) in. Gate times should be ordered.
times_to_split_at
Ordered list of time steps at which to separate fused gates. Each element of the output will contain gates from a single 'window' in this list.
Returns
A vector of fused gate objects. Each element is a set of gates acting on a specific pair of qubits which can be applied as a group.