We're celebrating World Quantum Day 2022! Join us

qsim:: BasicGateFuser

#include <fuser_basic.h>

Stateless object with methods for aggregating Gate s 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. This class is deprecated. It is recommended to use MultiQubitGateFuser from fuser_mqubit.h.

Inheritance

Inherits from: qsim::Fuser< IO, Gate >

Public types

GateFused using

Public static functions

FuseGates (const Parameter & param, unsigned num_qubits, const std::vector< Gate > & gates)
std::vector< GateFused >
Stores sets of gates 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 sets of gates 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 sets of gates 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 sets of gates that can be applied together.

Structs

qsim:: BasicGateFuser:: Parameter

User-specified parameters for gate fusion.

Public types

GateFused

qsim::GateFused< RGate > GateFused

Public static functions

FuseGates

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

Stores sets of gates that can be applied together.

Only one- and two-qubit gates will get fused. 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 of the gates that act on the same qubits should be ordered. Gates that are out of time order should not cross the time boundaries set by measurement gates.
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 > FuseGates(
  const Parameter & param,
  unsigned num_qubits,
  const std::vector< Gate > & gates,
  const std::vector< unsigned > & times_to_split_at
)

Stores sets of gates that can be applied together.

Only one- and two-qubit gates will get fused. 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 of the gates that act on the same qubits should be ordered. Gates that are out of time order should not cross the time boundaries set by times_to_split_at or by measurment gates.
times_to_split_at
Ordered list of time steps (boundaries) 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 > FuseGates(
  const Parameter & param,
  unsigned num_qubits,
  typename std::vector< Gate >::const_iterator gfirst,
  typename std::vector< Gate >::const_iterator glast
)

Stores sets of gates that can be applied together.

Only one- and two-qubit gates will get fused. 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 of the gates that act on the same qubits should be ordered. Gates that are out of time order should not cross the time boundaries set by measurement gates.
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 > 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 sets of gates that can be applied together.

Only one- and two-qubit gates will get fused. 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 of the gates that act on the same qubits should be ordered. Gates that are out of time order should not cross the time boundaries set by times_to_split_at or by measurment gates.
times_to_split_at
Ordered list of time steps (boundaries) 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.