# Fun with Higher Dimensions

image credit

I have been working on a project during which the opportunity arose to work with 2-dimensional vectors as 3-dimensional qubits. The problem I soon encountered was that all the vectors had lengths shorter than one. It’s been challenging to find information about how to work with this situation, which is why I am sharing what I have learned about it thus far. I am hoping that social media threads might open up insights into working in even higher dimensions, which is something I am now actively working on.

Inside the Bloch Sphere

A Bloch Sphere, the 3-dimensional graphical representation of a qubit, is a unit sphere. A unit sphere is a sphere with a radius of one, which simplifies certain calculations. If we cut the Bloch Sphere in half at the equator, we have a surface formed by a 2-dimensional x-y plane. The x-axis runs from the + state to the - state and the y-axis runs from the i state to the -i state.

Now imagine having a set of 2-dimensional points on this x-y plane, as shown below. “Quantity of item 1" is the x-axis, and “quantity of item 2" is the y-axis. The actual datapoints don’t matter; the important visualization is that the gray points are well inside the surface of the sphere.

image credit

Every datapoint can be represented by a vector (aka “line”) from the origin (0, 0), as well as by an angle φ (“phi”) away from the x-axis. The vector length ρ (“rho”) is the square root of the sum of the squares of the x and y values (sqrt(x^2 + y^2)). The angle φ is the inverse tangent of y over x (atan2(y/x)).

A significant problem arises when you try to rotate φ away from the x-axis. The vector doesn’t have a length ρ, it has a length 1. The point is on the surface of the sphere, which is not where you want to be.

The first solution I came up with was to use two vectors. I’m not providing a visual because the second method is better, but I will briefly describe my thought process on my way to discovering the second method.

I drew a line through the point that was perpendicular to the vector. The ends of that line intersected the surface of the sphere at two points that could each be represented by length 1 vectors from the origin. The angle of each vector away from the datapoint is the inverse cosine of ρ (acos(ρ)). From the x-axis, rotate this new angle plus φ past the datapoint for one vector, and rotate this new angle minus φ in the opposite direction of the datapoint for the second vector. By representing datapoints as pairs of pure state vectors, you can effectively work with their mixed state vectors.

While this 2-vector approach might end up being one potential solution for 3-dimensional mixed states — I’d prefer to go d+1 — I soon thought of a better way to do this for 2-dimensional mixed states, which I present to you now.

image credit

Imagine that the new 3-dimensional vector ψ (“psi”) is solid. Then imagine holding a flashlight directly above the vector so that it casts a shadow straight down, right onto the dashed line on the x-y plane. The dashed line shadow represents the vector with length ρ at the angle φ away from the x-axis. We can represent the mixed state datapoint as the projection of a higher-dimensional vector into a lower dimension. We can then work with our datapoint by working with one vector instead of two.

The angle of ψ away from the datapoint, once again, is the inverse cosine of ρ. Instead of rotating away from the datapoint on the x-y axis, you rotate away from it along the z axis. Since all qubits are initialized at the ground state, which is the 0 at the north pole, the easiest way to rotate ψ is to first rotate θ (“theta”) around the y-axis (ry(θ) q; in OpenQASM). This is a rotation toward the x-axis from the z-axis. The angle θ is a right angle (π/2 in radians) minus the inverse cosine of ρ (π/2 - acos (ρ)). The second rotation is the angle φ around the z-axis (rz(φ) q;). This is a rotation toward the y-axis away from the x-axis. Feel free to use other gates; RY and RZ are useful for visualization.

At this point, working with φ is simply a matter of rotating ψ around the z-axis. Changing ρ is a matter of increasing or decreasing θ, which you can visualize as lengthening (opening θ) or shortening (closing θ) the “shadow” of ψ.

“What is the application of this,” you might ask. My objective is to work with large 2-dimensional datasets using vector operations, which quantum processors are good at. The key to the algorithm might ultimately be leveraging higher-dimensional space to represent the most possible datapoints with the fewest possible qubits. It’s a work in progress.

I have not yet attended the Church of the Larger Hilbert Space, but I’m looking forward to it.

## More from Brian N. Siegelwax

Independent Quantum Algorithm Designer https://www.linkedin.com/in/brian-siegelwax https://twitter.com/BSiegelwax?s=09 https://github.com/bsiegelwax