Normalise

QSharp

On this page:

Normalise

The state vector which a quantum register represents has the following property:

|α|2 + |β|2 + ... + |n|2 = 1

The sum of the squared absolute value of each amplitude must equal 1. Each amplitude value of a randomly generated register is guaranteed to satisfy this condition, however these coefficients are often difficult to work with. Preparing a register with your own ampltude values is supported by Quantum Console, however these values will need to be normalised as well.

Syntax

The Quantum Console syntax for this operation is:

NORMALISE();

* Note that the command has no parameters.

Normalised Form

To calculate whether a state vector appears in a normalise form, the sum of the squared absolute value of each ampltude must equal 1.

To perform this calculation:

  1. Compute the absolute value of each amplitude, then square than value
  2. Sum the computed values

If the result is equal to 1, then the state vector appears in normalised form.

Example

The following table illustrates the normalisation recalculation process on a 3 qubit register, using amplitudes that are multiples of 10:

    Values     New values Normalised values
i   ni |ni| (ni)2 (ni) / R |ni / R|2
0 000|› 10 10 100 0.070014004 0.004901961
1 001|› 20 20 400 0.140028008 0.019607843
2 010|› 30 30 900 0.210042013 0.044117647
3 011|› 40 40 1600 0.280056017 0.078431373
4 100|› 50 50 2500 0.350070021 0.12254902
5 101|› 60 60 3600 0.420084025 0.176470588
6 110|› 70 70 4900 0.490098029 0.240196078
7 111|› 80 80 6400 0.560112033 0.31372549
Let S
 = ∑(ABS(ni)2)	//	Sum of
 = 20400

Let R
 = √(S)	//	Square root
 = √(20400)
 = 142.8285686

Let N
 = ∑(ABS((ni) / R)2)	//	Sum of
 = 1

Where i denotes the index of the amplitude, ni denotes the value of the amplitude, S denotes the sum of |ni|2, R denotes the square root of S, and finally, N denotes the normalised state vector value, comprising of the sum of ∑ |ni / R|2.

Normalisation

To normalise any state vector:

  1. Compute the sum of the absolute value squared of each amplitude
  2. Take the square root of the summed value, let as R
  3. Divide all amplitudes by the value R

Example 1

The following table illustrates the normalisation recalculation process on a 3 qubit register, using amplitudes between 0.0 and 1.0:

    Values    
i   ni |ni| (ni)2
0 000|› 0.331857021398009 0.331857021398009 0.110129083
1 001|› 0.0513909701393993 0.0513909701393993 0.002641032
2 010|› 0.213205457085919 0.213205457085919 0.045456567
3 011|› 0.0330167348350858 0.0330167348350858 0.001090105
4 100|› 0.762318448845313 0.762318448845313 0.581129417
5 101|› 0.118051697313154 0.118051697313154 0.013936203
6 110|› 0.489760477709359 0.489760477709359 0.239865326
7 111|› 0.0758437051576894 0.0758437051576894 0.005752268
Let S
 = ∑(ABS(ni)2)	//	Sum of
 = 1

As S is already equal to 1, this state vector is already in normalised form, no further calculations are required.

Example 2

The following table illustrates the normalisation recalculation process on a 3 qubit register, using postive and negative prime amplitudes between -20 and 20:

    Values     New values Normalised values
i   ni |ni| (ni)2 (ni) / R |ni / R|2
0 000|› 2 2 4 0.062408649 0.00389484
1 001|› -3 3 9 -0.093612974 0.008763389
2 010|› 5 5 25 0.156021623 0.024342747
3 011|› -7 7 49 -0.218430273 0.047711784
4 100|› 11 11 121 0.343247571 0.117818895
5 101|› -13 13 169 -0.405656221 0.164556969
6 110|› 17 17 289 0.530473519 0.281402155
7 111|› -19 19 6400 -0.592882169 0.351509266
Let S
 = ∑(ABS(ni)2)	//	Sum of
 = 1027

Let R
 = √(S)	//	Square root
 = √(1027)
 = 32.04684072

Let N
 = ∑(ABS((ni) / R)2)	//	Sum of
 = 1

The state vector is now in normalised form.



 

Copyright © 2024 carlbelle.com