Options
All
  • Public
  • Public/Protected
  • All
Menu

Photons class. A state of many photons, each with with dimensions: x, y, direction, polarization

see

{@link @Dimension.position}, {@link @Dimension.direction}, {@link @Dimension.polarization} Designed so that it will work with https://github.com/Quantum-Game/quantum-game-2 board.

todo

Think deeply about which things should change in-plance, and which: modify this object.

todo

A lot of things with interfaces to make them consistent.

Hierarchy

  • Photons

Index

Constructors

  • new Photons(sizeX: number, sizeY: number, vector: Vector, operators?: IXYOperator[], measurementVecs?: INamedVector[], measurementOps?: WeightedProjection[]): Photons
  • Create a board for photons. Mostly for internal use.

    Parameters

    • sizeX: number

      An integer, size x (width) of the board.

    • sizeY: number

      An integer, size y (height) of the board.

    • vector: Vector

      Vector with [x1, y1, dir1, pol1, ..., xn, yn, dirn, poln].

    • operators: IXYOperator[] = []

      A list of IXYOperator derived from elements from the board.

    • measurementVecs: INamedVector[] = []
    • measurementOps: WeightedProjection[] = []

    Returns Photons

Properties

cachedDiffU: Operator
dimX: Dimension
dimY: Dimension
measurementOps: WeightedProjection[]
measurementVecs: INamedVector[]
operators: IXYOperator[]
vector: Vector

Accessors

  • get nPhotons(): number
  • get sizeX(): number
  • Size x ('width') of the board.

    Returns number

  • get sizeY(): number
  • Size y ('height') of the board.

    Returns number

Methods

  • Act on single photons with the precomputed cachedDiffU.

    remark

    Absorption for states with n>1 photons is broken.

    • it tracks only a fixed-number of photons subspace.

    Returns Photons

    Itself, for chaining.

  • addPhotonFromIndicator(posX: number, posY: number, dir: string, pol: string): Photons
  • Add one more photon to the state, using Photons.vectorFromIndicator.

    Parameters

    • posX: number

      Position of the photon, x.

    • posY: number

      Position of the photon, y.

    • dir: string

      Direction from ['>', '^', '<', 'v].

    • pol: string

      Polarization from ['H', 'V', 'D', 'A', 'L', 'R'].

    Returns Photons

    Itself, for chaining.

  • deprecated

    Combine H and V polarization, to Right now kind od dirty, but should work

    todo

    Interface is clunky and restrictred to 1 particle.

    Returns IParticle[]

    Angles 0-360, starting from --> and moving counterclockwise |psi> = (are + i aim) |H> + (bre + i bim) |V>

  • todo

    Check that the cachedDiffU doesn't hammer performance.

    Returns Photons

    A deep copy of the same object.

  • ketString(complexFormat?: ComplexFormat, precision?: number): string
  • Generates a string for kets. See Vector.toString for formatting options.

    Parameters

    • complexFormat: ComplexFormat = 'cartesian'

      .

    • precision: number = 2

      Float precision.

    Returns string

    A ket string, e.g. (0.71 +0.00i) |3,1,>,V⟩ + (0.00 +0.71i) |2,2,v,V⟩.

  • measure(): default
  • Perform measurement given measurement projections and positive operators.

    Returns default

  • measureAbsorptionAtOperator(op: IXYOperator, photonId?: number): number
  • deprecated

    Measure the absolute absorbtion on a given tile.

    Parameters

    • op: IXYOperator

      Operator, assumed to be with dimensions [pol, dir].

    • photonId: number = 0

    Returns number

    Probability lost at tile (x, y) after applying the operator. Does not change the photon object.

  • propagatePhotonsWithOperator(yDirMeansDown?: boolean): Photons
  • Propagate all particles, using {@link createPhotonPropagator}. Use it for a reference. All practical operations with propagatePhotons.

    Parameters

    • yDirMeansDown: boolean = true

      or true, direction 'v' increments dimY.

    Returns Photons

    Itself, for chaining.

  • sampleTwoPhotonState(): [IPhotonPolarization[], IPhotonPolarization[]]
  • Sampling states for (possibly entangled) particles. A proof-of-concept, everything may change (including its mathematics). For product (i.e. pure, non-entangled) states the result is deterministic, up to the phase.

    Returns [IPhotonPolarization[], IPhotonPolarization[]]

  • updateMeasurements(xyVecs: IXYNamedVectors[], xyOps?: IXYNamedOperators[]): void
  • Parameters

    • xyVecs: IXYNamedVectors[]
    • xyOps: IXYNamedOperators[] = []

    Returns void

  • Add operators to photons and compute static cachedDiffU

    Parameters

    • operators: IXYOperator[]

      An array of board operators in IXYOperator format.

    Returns void

  • vectorIndicesForParticle(i: number): number[]
  • Dimension indices for particle i, for [posX, posY, dir, pol].

    note

    For internal use.

    Parameters

    • i: number

      Photon id, from [0, ..., nPhotons - 1]

    Returns number[]

    E.g. for 1: [4, 5, 6, 7]

  • vectorPosDirIndicesForParticle(i: number): number[]
  • Dimension indices for particle i, for [posX, posY, dir].

    note

    For internal use.

    Parameters

    • i: number

      Photon id, from [0, ..., nPhotons - 1]

    Returns number[]

    E.g. for 1: [4, 5, 6]

  • vectorPosIndicesForParticle(i: number): number[]
  • Dimension indices for particle i, for [posX, posY].

    note

    For internal use.

    Parameters

    • i: number

      Photon id, from [0, ..., nPhotons - 1]

    Returns number[]

    E.g. for 1: [4, 5]

  • vectorValuedMeasurement(op: IXYOperator, photonId?: number): { dirStr: string; inputProb: number; photonId: number; polStr: string; probability: number; projectedState: string; x: number; y: number }[]
  • deprecated

    Demo of measurement of one particle So far the basis is FIXED, so it won't give corrent results with operators absorbing in a basis that does not commute with this basis. Vide measureAbsorptionAtOperator as the structure is

    Parameters

    Returns { dirStr: string; inputProb: number; photonId: number; polStr: string; probability: number; projectedState: string; x: number; y: number }[]

    Only measurement (zeros excluded). Conditional state is NOT normalized (to avoid issues with division by ) FIXME: No return type

  • allDirectionsOps(): WeightedProjection[]
  • Generates a DirPol projections for completem projective, non-destructive measurement.

    Returns WeightedProjection[]

  • allDirectionsVec(factor?: number): INamedVector[]
  • Generates a DirPol basis for completem projective, destructive measurement.

    Parameters

    • factor: number = 1

      Multiplicative factor. Use Math.SQRT1_2 for 50% of detection.

    Returns INamedVector[]

  • emptySpace(sizeX: number, sizeY: number): Photons
  • Create an empty board for photons, with a given size.

    Parameters

    • sizeX: number

      An integer, size x (width) of the board.

    • sizeY: number

      An integer, size y (height) of the board.

    Returns Photons

  • Create an operator for a particular place, projecting only on the particular position.

    Parameters

    • sizeX: number

      Board size, x.

    • sizeY: number

      Board size, y.

    • op: IXYOperator

      Operator, assumed to be with dimensions [pol, dir].

    Returns Operator

    An operator [dimX, dimY, pol, dir].

  • localizeVector(sizeX: number, sizeY: number, x: number, y: number, vec: Vector): Vector
  • onePhotonByPolarization(v: Vector): IPhotonPolarization[]
  • Turns vector of a single photon in an array of amplitudes, grouped by polarization.

    Parameters

    • v: Vector

      Vector for one photon.

    Returns IPhotonPolarization[]

  • propagator(sizeX: number, sizeY: number, yDirMeansDown?: boolean): Operator
  • Create a propagator, given the board size.

    Parameters

    • sizeX: number

      Board size, x.

    • sizeY: number

      Board size, y.

    • yDirMeansDown: boolean = true

      For true, direction 'v' increments dimY.

    Returns Operator

    An operator, with dimensions [dimX, dimY, {@link Dimension.direction()}].

  • Turn an list of operators in a complete one-photon iteraction operator for the board.

    remark

    Some space for improvement with avoiding identity (direct sum structure), vide Operator.mulVecPartial.

    Parameters

    • sizeX: number

      Board size, x.

    • sizeY: number

      Board size, y.

    • opsWithPos: IXYOperator[]

      A list of [x, y, operator with [dir, pol]].

    Returns Operator

  • Turn an list of operators in a complete one-photon iteraction operator for the board (U - Id).

    Parameters

    • sizeX: number

      Board size, x.

    • sizeY: number

      Board size, y.

    • opsWithPos: IXYOperator[]

      A list of [x, y, operator with [dir, pol]].

    Returns Operator

  • vectorFromIndicator(sizeX: number, sizeY: number, posX: number, posY: number, dir: string, pol: string): Vector
  • Create a single photon vector.

    todo

    Aupport 'D', 'A', 'L' and 'R'.

    Parameters

    • sizeX: number

      Board size, x.

    • sizeY: number

      Board size, y.

    • posX: number

      Position of the photon, x.

    • posY: number

      Position of the photon, y.

    • dir: string
    • pol: string

      Polarization from ['H', 'V', 'D', 'A', 'L', 'R'].

    Returns Vector

    A vector [dimX, DimY, dir, pol], does not modify the object.

Generated using TypeDoc