Q2NS dev
ns-3 module
Loading...
Searching...
No Matches
q2ns-qgate.h File Reference

Gate helpers, gate descriptors, and predefined matrices for the standard q2ns gate set. More...

#include "ns3/q2ns-types.h"
#include "ns3/assert.h"
#include "ns3/nstime.h"
#include <cmath>
#include <cstddef>
#include <initializer_list>
#include <memory>
#include <utility>
Include dependency graph for q2ns-qgate.h:

Go to the source code of this file.

Classes

class  q2ns::QGate
 Lightweight gate descriptor used by QState backends. More...
 

Namespaces

namespace  q2ns
 
namespace  q2ns::gates
 

Enumerations

enum class  q2ns::QGateKind {
  q2ns::QGateKind::Custom , q2ns::QGateKind::I , q2ns::QGateKind::X , q2ns::QGateKind::Y ,
  q2ns::QGateKind::Z , q2ns::QGateKind::H , q2ns::QGateKind::S , q2ns::QGateKind::SDG ,
  q2ns::QGateKind::CNOT , q2ns::QGateKind::CZ , q2ns::QGateKind::SWAP
}
 Enumerates built-in gate kinds. More...
 

Functions

Matrix q2ns::MakeMatrix (std::initializer_list< std::initializer_list< Complex > > rows)
 Build a Matrix from nested initializer lists.
 
const Matrixq2ns::MatrixI ()
 Return the 1-qubit identity matrix.
 
const Matrixq2ns::MatrixX ()
 Return the Pauli-X matrix.
 
const Matrixq2ns::MatrixY ()
 Return the Pauli-Y matrix.
 
const Matrixq2ns::MatrixZ ()
 Return the Pauli-Z matrix.
 
const Matrixq2ns::MatrixH ()
 Return the Hadamard matrix.
 
const Matrixq2ns::MatrixS ()
 Return the phase gate matrix S = diag(1, i).
 
const Matrixq2ns::MatrixSDG ()
 Return the inverse phase gate matrix SDG = diag(1, -i).
 
const Matrixq2ns::MatrixCNOT ()
 Return the CNOT matrix with control qubit 0 and target qubit 1.
 
const Matrixq2ns::MatrixCZ ()
 Return the CZ matrix.
 
const Matrixq2ns::MatrixSWAP ()
 Return the SWAP matrix.
 
const Matrixq2ns::MatrixOf (QGateKind k)
 Return the built-in matrix for a non-custom gate kind.
 
QGate q2ns::gates::I (ns3::Time d=ns3::Seconds(0))
 Return the identity gate descriptor.
 
QGate q2ns::gates::X (ns3::Time d=ns3::Seconds(0))
 Return the Pauli-X gate descriptor.
 
QGate q2ns::gates::Y (ns3::Time d=ns3::Seconds(0))
 Return the Pauli-Y gate descriptor.
 
QGate q2ns::gates::Z (ns3::Time d=ns3::Seconds(0))
 Return the Pauli-Z gate descriptor.
 
QGate q2ns::gates::H (ns3::Time d=ns3::Seconds(0))
 Return the Hadamard gate descriptor.
 
QGate q2ns::gates::S (ns3::Time d=ns3::Seconds(0))
 Return the phase gate descriptor.
 
QGate q2ns::gates::SDG (ns3::Time d=ns3::Seconds(0))
 Return the inverse phase gate descriptor.
 
QGate q2ns::gates::CNOT (ns3::Time d=ns3::Seconds(0))
 Return the CNOT gate descriptor.
 
QGate q2ns::gates::CZ (ns3::Time d=ns3::Seconds(0))
 Return the CZ gate descriptor.
 
QGate q2ns::gates::SWAP (ns3::Time d=ns3::Seconds(0))
 Return the SWAP gate descriptor.
 
QGate q2ns::gates::Custom (const Matrix &U, ns3::Time d=ns3::Seconds(0))
 Return a custom gate descriptor by copying a matrix.
 
QGate q2ns::gates::Custom (Matrix &&U, ns3::Time d=ns3::Seconds(0))
 Return a custom gate descriptor by moving a matrix.
 

Detailed Description

Gate helpers, gate descriptors, and predefined matrices for the standard q2ns gate set.

Definition in file q2ns-qgate.h.