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

Fidelity sweep over depolarizing probability. More...

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/q2ns-analysis.h"
#include "ns3/q2ns-netcontroller.h"
#include "ns3/q2ns-qmap.h"
#include "ns3/q2ns-qnode.h"
#include "ns3/q2ns-qstate.h"
#include "ns3/q2ns-qubit.h"
#include "ns3/simulator.h"
#include <iomanip>
#include <iostream>
#include <random>
#include <vector>
Include dependency graph for q2ns-2-fidelity-example.cc:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

Fidelity sweep over depolarizing probability.

Demonstrates q2ns::analysis::Fidelity by sending |+> through a DepolarizingQMap at several probability values and printing the fidelity against the ideal |+> reference for each trial.

Because DepolarizingQMap is a trajectory model (it applies one specific Pauli per shot), the per-trial fidelity is 0 or 1. Run multiple times with different seeds to see the stochastic nature.

Definition in file q2ns-2-fidelity-example.cc.

Function Documentation

◆ main()

int main ( )

Definition at line 41 of file q2ns-2-fidelity-example.cc.

References q2ns::NetController::CreateNode(), q2ns::analysis::Fidelity(), q2ns::NetController::GetState(), q2ns::gates::H(), and q2ns::NetController::InstallQuantumLink().

Here is the call graph for this function: