Computing With Ellipses
23 Oct 2018



1-bit operators

Hermitian and unitary operators

The operators (the most primitive mathematical operations) that will be applied to the 1-bit states created in the previous section are rotations of the computational sphere about some axis. That is, the result of the computation for each input state is another state on the sphere that is the rotated image of the input state. If the angle of rotation is exactly 180 degrees, the operator is called "hermitian". If the angle of rotation is other than 180 degrees (anywhere from -180 to +180 degrees), the operator is called "unitary". In this section we will be working with hermitian operators only.


Here are some simple properties of these operators:

  1. If the angle of rotation of a unitary operator is exactly + or - 180 degrees, it is also a hermitian operator.
  2. Hermitian operators are also unitary, but for a fixed angle of rotation.
  3. Although the direction of rotation matters for a unitary operator, it does not for a hermitian operator. Both +180 and -180 degree rotations are the same operator (produce the same computation).
  4. There are an infinite number of unitary and hermitian operators, corresponding to all possible axes of the computational sphere. In some sense there are more unitary operators than hermitian operators, because for each axis choice there are many possible angles. A unitary operator can be visualized as a vector from the center of the computational sphere to a point on the surface, whereas a hermitian operator is visualized as a double-ended line segment through the sphere, but with no arrowheads, since there is no "sense" of direction to the rotation.
  5. For each operator type, there are two points on the sphere (the axial points) that do not move (i.e. the outputs of the computation are the same as the inputs). These two 1-bit states are the eigenvectors of the operator.
  6. A hermitian operator applied twice returns the computational sphere to its original orientation. Therefore, every hermitian operator is its own inverse. Similarly, the square of every hermitian operator is the identity operator.

Consider two 1-bit states on the sphere, s1 and s2, where s1 is the input state and s2 is the output state (the result of the computation on s1). For any two such states, there are hermitian and unitary operators that map one to the other (i.e. s2 is a rotated version of s1). There are three different cases:

  1. s2 is the same state as s1. In this case both the hermitian (yellow) and the unitary (blue) operators have the same axis: the points s1 and s2, but while there is only a single hermitian operator mapping s1 to s2, there are an infinite number of unitary operators, corresponding to rotations by any angle about that axis.
  2. s2 is different from, but not orthogonal to, s1. In this case there is a single hermitian operator, with its axis mid-way between s1 and s2 on the sphere (all on a great circle). There is also a single unitary operator, but its axis is perpendicular to the plane containing s1, s2, and the origin of the sphere, so that it is perpendicular to the hermitian operator axis as well (although they are not orthogonal states).
  3. s2 is orthogonal to s1. In this case there are an infinite number of hermitian and unitary operators that map s1 to s2: any operator with its axis of rotation within the perpendicular plane between the two antipodal points. Also in this case, the unitary operators are + and -180 degrees only (which are the same operator, and also hermitian).
Standard hermitian operators: X, Z, Y, and H

When a 1-bit state is represented as a pair of cosine signals, as on the previous page, the electronic circuits that perform the basic operators are quite simple:

X

The X operator rotates the computational sphere 180 degrees about the DA axis. This can be effected by simply swapping the two channels of the 1-bit input state:

C1 --> C2, and
C2 --> C1

The circuit for this operator involves just switching the two inputs to the state detection hardware. In the photo below, the green (channel 2) and red (channel 1) outputs are crossed (compare to fig018):


This has the effect of reflecting the ellipse representing each 1-bit state in the line y = x (at 45 degrees), and flipping its chirality (color):


Below are plots showing an input point distribution (green) and its outputs (blue, at left), and a comparison between the output of the circuit and a calculation of the X operator applied to the same input points (at right). For this test figure, the mean error between measured and computed points is 0.686 degrees, and the maximum error is 0.970 degrees (each colored point is 1 degree wide):


Below is a plot showing the hermitian operators calculated from each pair of input and output points, using the procedure described above. Only non-orthogonal pairs were used. Yellow line segments are the axes of the calculated operators. The white line segment is the average of all axes. Red line segments belong to near-orthogonal pairs of points, and are excluded. (Recall from above that there are an infinite number of hermitian operators that map between orthogonal points, and they can be distributed anywhere on the computational sphere, depending on the orientation of each point pair.) The average axis is within 0.125 degrees of the true axis of the X operator:


Below are plots showing the hermitian operators calculated from each pair of 1000 randomly distributed input and output points. Again, only non-orthogonal pairs were used. In this case, the average error between measured and computed outputs is 0.607 degrees, with a maximum error of 1.053 degrees. The average axis is within 0.186 degrees of the true axis of the X operator:




Z

The Z operator rotates the computational sphere 180 degrees about the HV axis. This can be effected by inverting the second channel of the 1-bit input state:

C1 -->  C1, and
C2 --> -C2

The circuit for this operator involves an op-amp configured for a gain of -1:


This has the effect of reflecting the ellipse representing each 1-bit state in the line x = 0 (at 90 degrees), and flipping its chirality (color):


Below are plots showing the hermitian operators calculated from pairs of input (green) and output (blue) points of a simple figure transformed by the Z operator. Only non-orthogonal pairs were used. The average axis is within 0.210 degrees of the true axis of the Z operator, and the average error between measured and computed outputs is 0.458 degrees, with a maximum error of 0.939 degrees:


Below are plots showing the hermitian operators calculated from each pair of 1000 randomly distributed input and output points. Again, only non-orthogonal pairs were used. In this case, the average error between measured and computed outputs is 0.582 degrees, with a maximum error of 1.151 degrees. The average axis is within 0.073 degrees of the true axis of the Z operator:


The Z operator can also be performed by inverting the first channel of input:

C1 --> -C1, and
C2 -->  C2

In the following plots, the average axis is within 0.298 degrees of the true axis of the Z operator, and the average error between measured and computed outputs is 0.678 degrees, with a maximum error of 1.147 degrees:


In the random case, the average error between measured and computed outputs is 0.749 degrees, with a maximum error of 1.437 degrees. The average axis is within 0.065 degrees of the true axis of the Z operator:


In fact, there are an infinite number of circuits that perform the Z operator. These circuits differ only in the phase variation applied to each channel of input. Any phase variation can be distributed between the two channels (e.g. +90 degrees and -90 degrees), so long as the accumulated total phase difference between them at output is 180 degrees.


Y

The Y operator rotates the computational sphere 180 degrees about the GR axis. This can be effected by a composition of the Z operator followed by the X operator, which yields:

C1 --> -C2, and
C2 -->  C1

The circuit for this operator involves an op-amp configured for a gain of -1, and also switching the two inputs to the state detection hardware:


This has the effect of rotating the ellipse representing each 1-bit state 90 degrees about the origin, but not changing its chirality:


Below are plots showing the hermitian operators calculated from pairs of input (green) and output (blue) points of a simple figure transformed by the Y operator. Only non-orthogonal pairs were used. The average axis is within 0.023 degrees of the true axis of the Y operator, and the average error between measured and computed outputs is 0.479 degrees, with a maximum error of 0.987 degrees:


Below are plots showing the hermitian operators calculated from each pair of 1000 randomly distributed input and output points. Again, only non-orthogonal pairs were used. In this case, the average error between measured and computed outputs is 0.560 degrees, with a maximum error of 1.047 degrees. The average axis is within 0.107 degrees of the true axis of the Y operator:


The Y operator can also be performed by a composition of the X operator followed by the Z operator, which yields:

C1 -->  C2, and
C2 --> -C1

In the following plots, the average axis is within 0.161 degrees of the true axis of the Y operator, and the average error between measured and computed outputs is 0.853 degrees, with a maximum error of 1.355 degrees:


In the random case, the average error between measured and computed outputs is 0.879 degrees, with a maximum error of 1.636 degrees. The average axis is within 0.117 degrees of the true axis of the Y operator:


Again, there are an infinite number of circuits that perform the Y operator, which differ in the phase variation applied to each channel of input, either before or after the swap. Any phase variation can be distributed between the channels (e.g. +90 degrees and -90 degrees), so long as the accumulated total difference between them at output is 180 degrees.


H

The H (Hadamard) operator rotates the computational sphere 180 degrees about an axis that is half-way between the X axis and the Z axis (i.e. half-way between H and D on the sphere). This is effected by the sum of the X and Z operators:

H = X + Z = C1 --> C2 + C1, and
            C2 --> C1 - C2

By '+' I actually mean 'average', or the midpoint between two signals, and by '-' I mean adding the inverted signal. The circuit for this operator involves an op-amp configured for a gain of -1, and two additional op-amps to perform the summations. In the photo below, the channel 1 output is now the yellow wire:


This has a more complicated effect on the ellipse representing each 1-bit state. See if you can guess what this relationship is:


In the following plots, the average axis is within 0.127 degrees of the true axis of the H operator, and the average error between measured and computed outputs is 0.282 degrees, with a maximum error of 0.643 degrees:


In the random case, the average error between measured and computed outputs is 0.330 degrees, with a maximum error of 0.799 degrees. The average axis is within 0.073 degrees of the true axis of the H operator:


It is interesting to note that, with this particular combination of electronic components, the accuracy of the H operator is actually better than that of the I operator (identity, no transformation), which is 0.413 degrees on average.

You can play with various 1-bit operators in some old Javascript code here:


©Sky Coyote 2018