MeasurementLayer<T>

Layers · AiDotNet.NeuralNetworks.Layers

Represents a layer that performs quantum measurement operations on complex-valued input tensors.

Inheritance: LayerBase<T> → MeasurementLayer<T>

Implements: IShapeContract

For Beginners

This layer converts quantum information into regular probabilities.

Think of it like a bridge between the quantum and classical worlds:

  • In quantum computing, information exists in “superposition” (multiple states at once)
  • This layer converts that quantum information into classical probabilities
  • It’s similar to how quantum physics says we can only observe probabilities in the real world

For example, if you have a quantum state representing a coin that’s in both heads and tails at the same time, the measurement layer would convert this to classical probabilities like “60% chance of heads, 40% chance of tails.”

This is a fundamental concept in quantum computing and quantum mechanics.

How It Works

The MeasurementLayer transforms complex-valued quantum state amplitudes into classical probabilities. It calculates the probability distribution from a quantum state vector by taking the squared magnitude of each complex amplitude and normalizing the results to ensure they sum to 1.0.

Constructors

Constructor Summary
MeasurementLayer(int size) Initializes a new instance of the MeasurementLayer class with the specified size.

Properties

Property Summary
bool SupportsTraining { get; } Gets a value indicating whether this layer supports training.

Methods

Method Summary
IReadOnlyList<OutputAxisContract> OutputAxesFor(int inputRank) Derived from this type’s [TensorLayout] declarations.
void ResetState() Resets the internal state of the measurement layer.