TransformedContinuousDistribution function

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Random

Package: Microsoft.Quantum.QSharp.Foundation

Given a continuous distribution, returns a new distribution that transforms the original by a given function.

function TransformedContinuousDistribution (transform : (Double -> Double), distribution : Microsoft.Quantum.Random.ContinuousDistribution) : Microsoft.Quantum.Random.ContinuousDistribution

Input

transform : Double -> Double

A function that transforms variates of the original distribution to the transformed distribution.

distribution : ContinuousDistribution

The original distribution to be transformed.

Output : ContinuousDistribution

A new distribution related to distribution by the transformation given by transform.

Example

The following two distributions are identical:

let dist1 = ContinuousUniformDistribution(1.0, 2.0);
let dist2 = TransformedContinuousDistribution(
    PlusD(1.0, _),
    ContinuousUniformDistribution(0.0, 1.0)
);