Struct GateIndices

Struct Documentation

struct GateIndices

Internal utility struct to track data indices of application for operations.

Each external index represents a bitstring outside of wires. For example, if we have four qubits and wires = {1,2}, external indices are {0000B, 0001B, 1000B, 1001B}. For each external index, internal indices are bitstrings for the wires. In the example, we have internal indices {0000B, 0010B, 0100B, 0110B}.

Public Functions

inline GateIndices(const std::vector<size_t> &wires, size_t num_qubits)

Create indices for gates.

Public Members

const std::vector<size_t> internal

Internal indices. For the given wires with size n_wire, the output size is 2^n_wire.

const std::vector<size_t> external

external External indices. For the given wires with size n_wire, the output size is 2^(num_qubits - n_wires).