Q2NS dev
ns-3 module
Loading...
Searching...
No Matches
q2ns-2-basis-measurement-example.cc File Reference

Measurement bases, custom circuits, and custom gate definitions in q2ns. More...

#include "ns3/core-module.h"
#include "ns3/q2ns-netcontroller.h"
#include "ns3/q2ns-qgate.h"
#include "ns3/q2ns-qnode.h"
#include "ns3/q2ns-types.h"
#include "ns3/rng-seed-manager.h"
#include <iostream>
Include dependency graph for q2ns-2-basis-measurement-example.cc:

Go to the source code of this file.

Functions

int main (int, char **)
 

Detailed Description

Measurement bases, custom circuits, and custom gate definitions in q2ns.

Demonstrates:

  • Preparing eigenstates and measuring in X, Y, and Z bases using the ns-3 scheduler
  • Defining a custom gate by composing H and S via matrix product
  • Defining the same gate entry-by-entry using MakeMatrix and Complex{re, im}

Definition in file q2ns-2-basis-measurement-example.cc.

Function Documentation

◆ main()

int main ( int  ,
char **   
)

Definition at line 30 of file q2ns-2-basis-measurement-example.cc.

References q2ns::NetController::CreateNode(), q2ns::gates::Custom(), q2ns::gates::H(), q2ns::MakeMatrix(), q2ns::MatrixH(), q2ns::MatrixS(), q2ns::gates::S(), q2ns::NetController::SetQStateBackend(), and q2ns::gates::X().

Here is the call graph for this function: