|
Code for: The Influence of Experimental Imperfections on Photonic GHZ State Generation
|
Definition of the data structure used to represent states. Inherits from boost::container::flat_map<Key, Val>. More...
#include <State.hpp>
Public Member Functions | |
| State () | |
| Construct a new (empty) State object. | |
| State (Key k) | |
| Construct a new State object from a single key with amplitude 1.0. | |
| void | set (Val(*f)(const WF &, const WF &)) |
| Sets the overlap function to f. | |
| void | set (Real t) |
| Sets the tolerance to t. | |
| void | set (Int n) |
| Sets the lossMode to n. | |
| void | set (Par &&p) noexcept |
| Sets the actual State data to p. | |
| void | set (const Par &p) |
| Sets the actual State data to p. | |
| void | set (const Key &k, const Val &v) |
| Inserts/assigns a new Key Value pair. | |
| void | set (Key &&k, const Val &v) |
| Inserts/assigns a new Key Value pair. | |
| void | set (Int a, Int b, Int c, const Val &v) |
| Inserts/assigns a new Key Value pair. The key is implicitly given by (a,b,c). | |
| void | add (const Par &p) |
| Adds an state-like object to a State. If a Key is already in the state the amplitudes are added. | |
| void | add (Par &&p) |
| Adds an state-like object to a State. If a Key is already in the state the amplitudes are added. | |
| void | add (const Par &p, const Val &v) |
| Adds an scaled state-like object to a State. If a Key is already in the state the amplitudes are added. | |
| Real | norm () const |
| Returns the norm of a state. | |
| Par | getPar () |
| Get the Par, i.e. boost::container::flat_map<Key, Val>, object. | |
| Par && | get_parMoved () |
| Get the Par, i.e. boost::container::flat_map<Key, Val>, object moved. | |
| OWF | addBasisElem (const WF &) |
| Uses Gram-Schmidt procedure to add a basis element to the orthogonal basis. Used to get orthogonal Distinguishability modes. | |
| void | addPhoton (const WF &, Int, Int) |
| Adds num new photon to the state with the wave function wf in the Spatial&Polarization mode m. | |
| void | apply (const std::vector< Val > &U, const std::vector< Int > &modes) |
| Applies a unitary U in second-quantization on the Spatial&Polarization modes in modes (max 2). | |
| void | apply (const Val &U, const Int &mode) |
| Applies a unitary U in second-quantization on the Spatial&Polarization modes in modes (max 1). | |
| void | swap (Int a, Int b) |
| Swaps two Spatial&Polarization modes, used to implement a PBS. | |
| void | clean () |
| Removes all Key-Val pairs where the abs of the amplitude is lower than tol. | |
| void | normalise () |
| Normalizes the state. | |
| void | mul (Val) |
| Multiplies the state with a scalar n. | |
| State< Key, Val, Real > | overlapWithFilter (const boost::container::flat_map< Int, Int > &, const std::vector< std::vector< Int > > &, const std::vector< boost::container::flat_map< Int, Int > > &) |
| Computes the overlap to a measurement pattern and filters according to a fidelity reference. | |
| void | overlapCompl (const std::vector< boost::container::flat_map< Int, Int > > &, const std::vector< std::vector< Int > > &={}) |
| Keeps the part of the state that is either rejected because of the measurement result or because of post-selection. | |
| void | loss (const std::vector< Int > &) |
| Performes loss of one photons on the modes in modes. | |
| void | notEmpty (const std::vector< std::vector< Int > > &) |
| Filters out these key that haven't at least one photon in on of the modes in allModes. | |
| void | sameDModeDel (const std::vector< std::vector< Int > > &, const std::vector< Val > &) |
| Keeps the keys where all Distinguishability Modes are the same for one of the collection of modes in modes. | |
Definition of the data structure used to represent states. Inherits from boost::container::flat_map<Key, Val>.
| std::vector< Val > State< Key, Val, Real >::addBasisElem | ( | const WF & | wf | ) |
Uses Gram-Schmidt procedure to add a basis element to the orthogonal basis. Used to get orthogonal Distinguishability modes.
| wf | Wave-function of the new entry represented as vector |
| void State< Key, Val, Real >::addPhoton | ( | const WF & | wf, |
| Int | mode, | ||
| Int | num ) |
Adds num new photon to the state with the wave function wf in the Spatial&Polarization mode m.
| wf | Wave function of the new photons represented as vector |
| mode | Spatial&Polarization mode of the new photons |
| num | Number of new photons |
|
inline |
Applies a unitary U in second-quantization on the Spatial&Polarization modes in modes (max 2).
| U | Unitary represented as line |
| modes | modes affected by the operation |
|
inline |
Applies a unitary U in second-quantization on the Spatial&Polarization modes in modes (max 1).
| U | Unitary, i.e. here a number with abs value 1 |
| mode | mode affected by the operation |
|
inline |
Get the Par, i.e. boost::container::flat_map<Key, Val>, object moved.
Get the Par, i.e. boost::container::flat_map<Key, Val>, object.
|
inline |
Performes loss of one photons on the modes in modes.
| modes | Spatial&Polarization modes to perform loss on |
Multiplies the state with a scalar n.
| n | Scalar to multiply the state with |
Returns the norm of a state.
|
inline |
Filters out these key that haven't at least one photon in on of the modes in allModes.
| allModes | Spatial&Distinguishability modes to check. |
|
inline |
Keeps the part of the state that is either rejected because of the measurement result or because of post-selection.
| MVec | Measurement pattern {S&P mode: total occupation-numer}. Filters out the Keys that overlap with one of these. |
| allModes | Modes for post-selection. Filters our those that are accepted by post-selection, i.e. for all of the vectors at least one is not occupied |
|
inline |
Computes the overlap to a measurement pattern and filters according to a fidelity reference.
Filters the state such that the measurement patter is overlapping and the fidelity reference is overlapping. Returns the part of the state that is accepted by the measurement and post-selection but is not overlapping with the fidelity refence.
| ref | The measurement pattern {S&P mode: total occupation-numer}. All S&P modes not in ref are accepted either way. |
| allModes | vector of vector of S&P modes of fidelity reference used to pre-filter. At least for one of them all modes have to be occupied. This implements post-selections. |
| fref | The fidelity reference. Used to further filter the measurement result, keeps that parts that could contribute to the fidelity. |
|
inline |
Keeps the keys where all Distinguishability Modes are the same for one of the collection of modes in modes.
| modes | For one of the vectors in modes, all Distinguishability Modes have to be the same for the key to be included in the output. |
| facs | Factors associated to the vectors in modes. These are used for the amplitudes correspoding to the keys, in which all the modes in the correspoding vector have the same Distinguishability Modes. |
|
inline |
Sets the actual State data to p.
| p | The data is set to. |
|
inline |
Inserts/assigns a new Key Value pair. The key is implicitly given by (a,b,c).
| a | Spatial&Polarization mode |
| b | Distinguishability mode |
| c | Occupation number. |
| v | new amplitude. |
Sets the lossMode to n.
| n | Int the lossMode is set to. |
|
inlinenoexcept |
Sets the actual State data to p.
| p | The data is set to. Moved input. |
Sets the tolerance to t.
| t | Real the tolerance is set to. |
|
inline |
Sets the overlap function to f.
| f | function that gets two vector<Val> and returns a Val, that is the overlap. |
|
inline |
Swaps two Spatial&Polarization modes, used to implement a PBS.
| a | First Spatial&Polarization mode |
| b | Second Spatial&Polarization mode |