Quantum Computer on Nvidia GPU

Abstract

Geometric Algebra formalism opens the door to developing a theory deeper than conventional quantum mechanics. Generalizations, stemming from implementation of complex numbers as geometrically feasible objects in three dimensions, unambiguous definition of states, observables, measurements, Maxwell equations solution in those terms, bring into reality a kind of physical fields spreading through the whole three-dimensional space and values of the time parameter. The fields can be modified instantly in all points of space and time values, thus eliminating the concept of cause and effect, and perceiving of one-directional time. In the suggested theory all measured observable values get available all together, not through looking one by one. In this way quantum computer appeared to be a kind of analog computer keeping and instantly processing information by and on sets of objects possessing an infinite number of degrees of freedom. As practical implementation, the multithread GPUs bearing the CUDA language functionality allow to simultaneously calculate observable measurement values at a number of space/time discrete points only restricted by the GPU threads capacity.

Share and Cite:

Soiguine, A. (2023) Quantum Computer on Nvidia GPU. Journal of Applied Mathematics and Physics, 11, 2195-2204. doi: 10.4236/jamp.2023.118141.

1. Introduction. What a Legacy Analog Computer Is

An analog computer is generally a type of computing device that uses the continuous variation aspect of physical phenomena to model the problem being solved [1] .

One of the most effective of such kind of relations is similarity between linear m echanical components and electrical components since they can be modeled using equations of the same form. Electronic analog computers were often used when a system of differential equations proved very difficult to solve by traditional means. As an example, the dynamics of a spring-mass system can

be described by the equation m y ¨ + d y ˙ + c y = m g , or y ¨ = d m y ˙ c m y g with y

as the vertical position of a mass m, d the damping coefficient, c the spring constant and g the gravity of Earth. The equivalent analog circuit consists of two integrators, Figure 1, for the state variables y ˙ (speed) and y (position), one inverter, Figure 2, and three potentiometers.

2. Geometric Algebra Type of Analog Modeling Computer

Different physical phenomena to model problems is considered below.

The circular polarized electromagnetic waves are the type of waves following from the solution of Maxwell equations in free space done in geometric algebra terms [2] [3] . Let us take the electromagnetic field in the form:

F = F 0 exp [ I S ( ω t k r ) ] (1)

which should be solution of

( t + ) F = 0 (2)

Solution of (2) should be sum of a vector (electric field e) and bivector (magnetic field I 3 h ):

F = e + I 3 h

with some initial conditions:

e + I 3 h | t = 0 , r = 0 = F 0 = e | t = 0 , r = 0 + I 3 h | t = 0 , r = 0 = e 0 + I 3 h 0

Figure 1. Integrator.

Figure 2. Inverter.

For given plane S in the (1) solution of the three-dimensions Maxwell Equation (2) has two options

F + = ( e 0 + I 3 h 0 ) exp [ I S ( ω t k + r ) ] , with k ^ + = I 3 I S , e ^ h ^ k ^ + = I 3 , and the triple { e ^ , h ^ , k ^ + } is right hand screw oriented, that’s rotation of e ^ to h ^ by π⁄2 gives movement of right hand screw in the direction of k + = | k | I 3 I S .

F = ( e 0 + I 3 h 0 ) exp [ I S ( ω t k r ) ] , with k ^ = I 3 I S , e ^ h ^ k ^ = I 3 , and the triple { e ^ , h ^ , k ^ } is left hand screw oriented, that’s rotation of e ^ to h ^ by π⁄2 gives movement of left hand screw in the direction of k = | k | I 3 I S or, equivalently, movement of right hand screw in the opposite direction, k .

e 0 and h 0 , initial values of e and h, are arbitrary mutually orthogonal vectors of equal length, lying on the plane S. Vectors k ± = ± | k ± | I 3 I S are normal to that plane. The length of the “wave vectors” | k ± | is equal to angular frequency ω .

Maxwell Equation (4.2) is a linear one. Then any linear combination of F + and F saving the structure of (1) will also be a solution.

Let’s write:

{ F + = ( e 0 + I 3 h 0 ) exp [ I S ω ( t ( I 3 I S ) r ) ] = ( e 0 + I 3 h 0 ) exp [ I S ω t ] exp [ I S [ ( I 3 I S ) r ] ] F = ( e 0 + I 3 h 0 ) exp [ I S ω ( t + ( I 3 I S ) r ) ] = ( e 0 + I 3 h 0 ) exp [ I S ω t ] exp [ I S [ ( I 3 I S ) r ] ] (3)

Then for arbitrary (real1) scalars λ and μ :

λ F + + μ F = ( e 0 + I 3 h 0 ) e I S ω t ( λ e I S [ ( I 3 I S ) r ] + μ e I S [ ( I 3 I S ) r ] ) (4)

is solution of (4.2). The item in the second parenthesis is weighted linear combination of two states with the same phase in the same plane but opposite sense of orientation. The states are strictly coupled, entangled if you prefer, because bivector plane should be the same for both, does not matter what happens with that plane.

Arbitrary linear combination (4.4) can be rewritten as:

λ e I P l a n e + φ + + μ e I P l a n e φ (5),

where

φ ± = cos 1 ( 1 2 cos ω ( t [ ( I 3 I S ) r ] ) ) ,

I P l a n e ± = I S sin ω ( t [ ( I 3 I S ) r ] ) 1 + sin 2 ω ( t [ ( I 3 I S ) r ] ) + I B 0 cos ω ( t [ ( I 3 I S ) r ] ) 1 + sin 2 ω ( t [ ( I 3 I S ) r ] ) + I E 0 sin ω ( t [ ( I 3 I S ) r ] ) 1 + sin 2 ω ( t [ ( I 3 I S ) r ] )

The triple of unit value basis orthonormal bivectors { I S , I B 0 , I E 0 } is comprised of the I S bivector, dual to the propagation direction vector; I B 0 is dual to initial vector of magnetic field; I E 0 is dual to initial vector of electric field. The expression (5) is linear combination of two geometric algebra states, g-qubits.

Linear combination of the two equally weighted basic solutions of the Maxwell equation F + and F , with λ = μ = 1 reads:

λ F + + μ F | λ = μ = 1 = 2 cos ω [ ( I 3 I S ) r ] ( 1 2 cos ω t + I S 1 2 sin ω t + I B 0 1 2 cos ω t + I E 0 1 2 sin ω t ) (6)

where cos φ = 1 2 cos ω t and sin φ = 1 2 1 + ( sin ω t ) 2 . It can be written in standard exponential form cos φ + sin φ I B = e I B φ .2

I will call such g-qubits spreons (or sprefields) because they spread over the whole three-dimensional space for all values of time and, particularly, instantly change under Clifford translations over the whole three-dimensional space for all values of time, along with the results of measurement of any observable.

3. CUDA GPU Simulation of Analog Modeling Computer

Measurement is by definition the result of action of operator, namely state, wave function, in the form of g-qubit ( α + I S β ) [4] , on an observable C:

( α I S β ) C ( α + I S β ) = ( α + I S β ) ˜ C ( α + I S β )

Take as first example the case of observable as a vector expanded in { I 3 I S , I 3 I B 0 , I 3 I E 0 } { e 1 , e 2 , e 3 } , basis vectors dual to bivectors { I S , I B 0 , I E 0 } :

C = c 1 e 1 + c 2 e 2 + c 3 e 3

Measure it with wave function (6):

The result is:

4 cos 2 ω [ ( I 3 I S ) r ] [ c 3 e 1 + ( c 1 sin 2 ω t + c 2 cos 2 ω t ) e 2 + ( c 2 sin 2 ω t c 1 cos 2 ω t ) e 3 ]

Geometrically that means that the measured vector is rotated by π 2 in the

I B 0 plane, such that the c 3 e 3 component becomes orthogonal to plane I S and remains unchanged. Two other vector components became orthogonal to I B 0 and I E 0 and continue rotating in I S with angular velocity.

One another example of measurement is that of the g-qubit type observable C 0 + C 1 B 1 + C 2 B 2 + C 3 B 3 (actually Hopf fibration) by a state α + β 1 B 1 + β 2 B 2 + β 3 B 3 [5] :

C 0 + C 1 B 1 + C 2 B 2 + C 3 B 3 α + β 1 B 1 + β 2 B 2 + β 3 B 3 C 0 + ( C 1 [ ( α 2 + β 1 2 ) ( β 2 2 + β 3 2 ) ] + 2 C 2 ( β 1 β 2 α β 3 ) + 2 C 3 ( α β 2 + β 1 β 3 ) ) B 1 + ( 2 C 1 ( α β 3 + β 1 β 2 ) + C 2 [ ( α 2 + β 2 2 ) ( β 1 2 + β 3 2 ) ] + 2 C 3 ( β 2 β 3 α β 1 ) ) B 2 + ( 2 C 1 ( β 1 β 3 α β 2 ) + 2 C 2 ( α β 1 + β 2 β 3 ) + C 3 [ ( α 2 + β 3 2 ) ( β 1 2 + β 2 2 ) ] ) B 3

with:

B 1 = I S , B 2 = I B 0 , B 3 = I E 0 , α = 2 cos ω [ ( I 3 I S ) r ] 1 2 1 2 cos ω t , β 1 = 2 cos ω [ ( I 3 I S ) r ] 1 2 sin ω t , β 2 = 2 cos ω [ ( I 3 I S ) r ] 1 2 cos ω t , β 3 = 2 cos ω [ ( I 3 I S ) r ] 1 2 sin ω t

gives a G 3 + element spreading through the three-dimensional space for all values of time parameter t:

4 cos 2 ω [ ( I 3 I S ) r ] [ C 0 + C 3 I S + ( C 1 sin 2 ω t + C 3 cos 2 ω t ) I B 0 + ( C 2 sin 2 ω t C 1 cos 2 ω t ) I E 0 ]

The current approach transcends common quantum computing schemes since the latter have tough problems of creating large sets of (entangled) qubits. In the current scheme any test observable can be placed into continuum of the ( t , r ) dependent values of the spreon state. All other observables measurement results are connected to a measured observable by Clifford translations thus giving any amount of the observables values spread over three dimensions and at all instants of time not generally following cause/effect ordering.

The sprefield hardware requires special implementation as a photonic/laser device. Instead, an equivalent simulation scheme can be used where the amount of available space points there is only restricted by the overall available Nvidia GPU number of threads.

In the case of measuring a vector the three parallel calculated measured by the sprefield vector components 4 cos 2 ω [ ( I 3 I S ) r ] c 3 , 4 cos 2 ω [ ( I 3 I S ) r ] ( c 1 sin 2 ω t + c 2 cos 2 ω t ) and 4 cos 2 ω [ ( I 3 I S ) r ] ( c 2 sin 2 ω t c 1 cos 2 ω t ) are processed using the following fragmental variants of CUDA code:

uint width = 512, height = 512;//optional value

dim3 blockSize(16, 16);//optional value

__global__ void quantKernel(float3* output, int dimx, int dimy, int dimz, float t)

{

float c1 = 1.0; //components of observable vectors

float c2 = 1.0;

float c3 = 1.0;

float omega = 12560000.0;// possible angular velocity in the sprefield

float tstep = 1.0f;

float factor = 0.0;

int qidx = threadIdx.x + blockIdx.x * blockDim.x;

int qidy = threadIdx.y + blockIdx.y * blockDim.y;

int qidz = threadIdx.z + blockIdx.z * blockDim.z;

size_t oidx = qidx + qidy*dimx + qidz*dimx*dimy;

output[oidx][0] = oidx*tstep;

factor =4*(cosf(omega * output[oidx][0])) * (cosf(omega * output[oidx][0]));

output[oidx][0] += factor * c3;

output[oidx][1] = oidx*tstep;

output[oidx][1] += factor * (c1 sin(2 * omega * t) + c2 cos (2 * omega * t));

output[oidx][2] = oidx*tstep;

output[oidx][2] += factor * (c2 sin(2 * omega * t) + c1 cos (2 * omega * t));

}

template

void init(char * devPtr, size_t pitch, int width, int height, int depth)

{

size_t qPitch = pitch * height;

int v = 0;

for (int z = 0; z < depth; ++z) {

char * slice = devPtr + z * qPitch;;

for (int y = 0; y < height; ++y) {

T * row = (T *)(slice + y * pitch);

for (int x = 0; x < width; ++x) {

row[x] = T(v++);

}

}

}

int keyboard(unsigned char key)

{

switch (key)

{

case (27):

cudaFree(d_output);

free(h_output);

return 1;

break;

default:

break;

}

}

int main(void)

{

VolumeType *h_volumeMem;

unsigned char key;

__device__ float g_fAnim = 0.0;

float3* h_output = (float3*)malloc(size * sizeof(float3));//array for measured vector //observable values

float3* d_output = NULL;

checkCudaErrors(

cudaMalloc((void **)&d_output, width * height * sizeof(float3)));

checkCudaErrors(cudaMemset(d_output, 0, width * height * sizeof(float3)));

cudaExtent volumeSizeBytes = make_cudaExtent(width, SIZE_Y, SIZE_Z);

cudaPitchedPtr d_volumeMem;

checkCudaErrors (cudaMalloc3D(&d_volumeMem, volumeSizeBytes));

size_t size = d_volumeMem.pitch * SIZE_Y * SIZE_Z;

h_volumeMem = (VolumeType *)malloc(size);

init<VolumeType>((char *)h_volumeMem, d_volumeMem.pitch, SIZE_X, SIZE_Y, SIZE_Z);

checkCudaErrors (cudaMemcpy(d_volumeMem.ptr, h_volumeMem, size, cudaMemcpyHostToDevice));

cudaArray * d_volumeArray;

cudaChannelFormatDesc channelDesc = cudaCreateChannelDesc ();

cudaExtent volumeSize = make_cudaExtent(SIZE_X, SIZE_Y, SIZE_Z);

checkCudaErrors ( cudaMalloc3DArray(&d_volumeArray, &channelDesc, volumeSize) );

cudaMemcpy3DParms copyParams = {0};

copyParams.srcPtr = d_volumeMem;

copyParams.dstArray = d_volumeArray;

copyParams.extent = volumeSize;

copyParams.kind = cudaMemcpyDeviceToDevice;

checkCudaErrors ( cudaMemcpy3D(&copyParams) );

while(1)

{

g_fAnim += 0.01f;

quantKernel<<<1,dim3(4,4,4)>>>(d_output,4,4,4, g_fAnim);

cudaError_t error = cudaGetLastError();

checkCudaErrors (cudaMemcpy(h_output, d_output, osize, cudaMemcpyDeviceToHost));

if (keyboard(key)==1)

exit(error);

}

return error;

}

The GPU CUDA case of simulation of measurement of a g-qubit type of observable differs in quantKernel GPU executed function:

__global__ void quantKernel(float4* output, int dimx, int dimy, int dimz, float t)

{

float c1 = 1.0; //components of observable vectors

float c2 = 1.0;

float c3 = 1.0;

float omega = 12560000.0;// variant of angular velocity in the sprefield

float tstep = 1.0f;

float factor = 0.0;

int qidx = threadIdx.x + blockIdx.x * blockDim.x;

int qidy = threadIdx.y + blockIdx.y * blockDim.y;

int qidz = threadIdx.z + blockIdx.z * blockDim.z;

size_t oidx = qidx + qidy*dimx + qidz*dimx*dimy;

output[oidx][0] = oidx*tstep;

factor =4*(cosf(omega * output[oidx][0])) * (cosf(omega * output[oidx][0]));

output[oidx][0] += factor * c3;

output[oidx][1] = oidx*tstep;

output[oidx][1] += factor * (c1sin(2*omega*t)+c2cos(2*omega*t));

output[oidx][2] = oidx*tstep;

output[oidx][2] += factor * (c2sin(2*omega*t)-c1cos(2*omega*t));

output[oidx][3] = factor;

}

More flexibility in measurements can be achieved by scattering of the sprefield wave function before applying to observables.

Arbitrary Clifford translation e I B C γ = cos γ + sin γ ( γ 1 I S + γ 2 I B 0 + γ 3 I E 0 ) acting on spreons (6) gives:

2 cos ω [ ( I 3 I S ) r ] [ 1 2 ( cos γ cos ω t γ 1 sin γ sin ω t γ 2 sin γ cos ω t γ 3 sin γ sin ω t ) + 1 2 ( cos γ sin ω t + γ 1 sin γ cos ω t γ 2 sin γ sin ω t + γ 3 sin γ cos ω t ) I S + 1 2 ( cos γ cos ω t + γ 1 sin γ sin ω t + γ 2 sin γ cos ω t γ 3 sin γ sin ω t ) I B 0 + 1 2 ( cos γ sin ω t γ 1 sin γ cos ω t + γ 2 sin γ sin ω t + γ 3 sin γ cos ω t ) I E 0 ] (7)

This result is defined for all values of t and r, in other words the result of Clifford translation instantly spreads through the whole three-dimensions for all values of time.

The instant of time when the Clifford translation was applied makes no difference for the state (7) because it is simultaneously redefined for all values of t. The values of measurements O ( C 0 , C 1 , C 2 , C 3 , I S , I B 0 , I E 0 , γ , γ 1 , γ 2 , γ 3 , ω , t , r ) also get instantly changed for all values of time of measurement, even if the Clifford translation was applied later than the measurement. That is an obvious demonstration that the suggested theory allows indefinite event casual order. In that way the very notion of the concept of cause and effect, ordered by time value increasing, disappears.

Since general result of measurement when Clifford translation takes place in an arbitrary plane is pretty complicated, I am only giving the result for the special case γ 1 = 1 and γ 2 = γ 3 = 0 (Clifford translation acts in plane I S ). The result is:

O ( C 0 , C 1 , C 2 , C 3 , I S , I B 0 , I E 0 , γ , γ 1 , γ 2 , γ 3 , ω , t , r ) γ 1 = 1 , γ 2 = γ 3 = 0 = 4 cos 2 ω [ ( I 3 I S ) r ] [ C 0 + ( C 2 sin 2 γ + C 3 cos 2 γ ) I S + ( C 1 sin 2 ω t + sin 2 γ cos 2 ω t ( C 2 + C 3 ) ) I B 0 + ( C 1 cos 2 ω t + sin 2 γ sin 2 ω t ( C 2 C 3 ) ) I E 0 ]

The only component of measurement, namely the one lying in plane I S , does not change with time. The I B 0 and I E 0 components do depend on the time of measurement being modified forward and backward in time if Clifford translation is applied. Clifford translation modifies measurement results of the past and the future.

4. Conclusion

In the suggested theory all measured observable values get available all together, not through looking one by one. In this way quantum computer appeared to be a kind of analog computer keeping and instantly processing information by and on sets of objects possessing an infinite number of degrees of freedom. The multithread GPUs bearing the CUDA language functionality allow to simultaneously calculate observable measurement values at a number of space/time discrete points, forward and backward in time, the number only restricted by the GPU threads capacity. That eliminates the tough hardware problem of creating huge and stable arrays of qubits, the base of quantum computing in conventional approaches.

NOTES

1Remember, in the current theory scalars are real ones. “Complex” scalars have no sense.

2Good to remember that the two basic solutions F + and F differ only by the sign of I 3 I S , which is caused by orientation of I S that in its turn defines if the triple { E ^ , H ^ , ± I 3 I S } is right-hand screw or left-hand screw oriented.

Conflicts of Interest

The author declares no conflicts of interest regarding the publication of this paper.

References

[1] Ulmann, B. (2022) Analog Computing. De Gruyter, Oldenbourg.
https://doi.org/10.1515/9783110787740
[2] Soiguine, A. (2019) Instantaneous Spreading of the g-Qubit Fields. Journal of Applied Mathematics and Physics, 7, 591-602.
https://doi.org/10.4236/jamp.2019.73043
[3] Soiguine, A. (2020) Scattering of Geometric Algebra Wave Functions and Collapse in Measurements. Journal of Applied Mathematics and Physics, 8, 1838-1844.
https://doi.org/10.4236/jamp.2020.89138
[4] Soiguine, A. (2020) The Geometric Algebra Lift of Qubits and Beyond. LAMBERT Academic Publishing, Saarbrucken.
[5] Soiguine, A. (2015) Geometric Phase in Geometric Algebra Qubit Formalism. Lambert Academic Publishing, Saarbrucken.

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.