Content uploaded by Alexander Soiguine
Author content
All content in this area was uploaded by Alexander Soiguine on Aug 13, 2023
Content may be subject to copyright.
Available via license: CC BY 4.0
Content may be subject to copyright.
Journal of Applied Mathematics and Physics, 2023, 11, 2195-2204
https://www.scirp.org/journal/jamp
ISSN Online: 2327-4379
ISSN Print: 2327-4352
DOI:
10.4236/jamp.2023.118141 Aug. 14, 2023 2195 Journal of Applied Mathematics and Physics
Quantum Computer on Nvidia GPU
Alexander Soiguine
SOiGUINE Quantum Computing, Aliso Viejo, USA
Abstract
Geometric Algebra formalism opens the door to developing a theory deeper
than conventional quantum mechanics. Generalizations, stemming from im-
plementation 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 po
ints 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 val-
ues 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 in-
finite number of degrees of freedom. As practical implementation, the mul-
tithread GPUs bearing the CUDA language functionality allow to simulta-
neously calculate observable measurement values at a number of space/time
discrete points only restricted by the GPU threads capacity.
Keywords
Geometric Algebra, Quantum Mechanics, Wave Functions, Maxwell
Equations, GPU, CUDA
1. Introduction. What a Legacy Analog Computer Is
An analog computer is generally a type of computing device that uses the conti-
nuous 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
How to cite this paper:
Soiguine, A. (2023
)
Quantum Computer on Nvidia GPU
.
Jou
r-
n
al of Applied Mathematics and Physics
,
11
, 2195-2204.
https:
//doi.org/10.4236/jamp.2023.118141
Received:
July 13, 2023
Accepted:
August 11, 2023
Published:
August 14, 2023
Copyright © 20
23 by author(s) and
Scientific
Research Publishing Inc.
This work is licensed under the Creative
Commons Attribution International
License (CC BY
4.0).
http://creativecommons.org/licenses/by/4.0/
Open Access
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2196 Journal of Applied Mathematics and Physics
traditional means. As an example, the dynamics of a spring-mass system can
be described by the equation
my dy cy mg++=
, or
dc
y y yg
mm
=−−−
with
y
as the vertical position of a mass
m
,
d
the damping coefficient,
c
the spring con-
stant and
g
the gravity of Earth. The equivalent analog circuit consists of two in-
tegrators, Figure 1, for the state variables
y−
(speed) and
y
(position), one in-
verter, 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:
( )
0exp S
F F I t kr
ω
= −⋅
(1)
which should be solution of
( )
0
tF∂ +∇ =
(2)
Solution of (2) should be sum of a vector (electric field
e
) and bivector (mag-
netic field
3
Ih
):
3
F e Ih= +
with some initial conditions:
3 0 3 0 30
0, 0
0, 0 0, 0
tr
tr tr
e Ih F e Ih e Ih
= =
= = = =
+==+=+
Figure 1. Integrator.
Figure 2. Inverter.
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2197 Journal of Applied Mathematics and Physics
For given plane
S
in the (1) solution of the three-dimensions Maxwell Equa-
tion (2) has two options
•
()
( )
0 30
exp
S
F e Ih I t k r
ω
++
= + −⋅
, with
3
ˆ
S
kII
+
=
,
3
ˆ ˆ
ˆ
ehk I
+
=
, and the
triple
{}
ˆˆ
ˆ,,ehk
+
is right hand screw oriented, that’s rotation of
ˆ
e
to
ˆ
h
by π⁄2
gives movement of
right hand screw
in the direction of
3S
k kII
+
=
.
•
( )
( )
0 30
exp
S
F e Ih I t k r
ω
−−
= + −⋅
, with
3
ˆS
kII
−= −
,
3
ˆ ˆ
ˆ
ehk I
−= −
, and the
triple
{ }
ˆ ˆ
ˆ,,ehk
−
is left hand screw oriented, that’s rotation of
ˆ
e
to
ˆ
h
by π⁄2
gives movement of
left hand screw
in the direction of
3S
k kII
−= −
or, equiva-
lently, movement of
right hand screw
in the opposite direction,
k
−
−
.
•
0
e
and
0
h
, initial values of
e
and
h
, are arbitrary mutually orthogonal
vectors of equal length, lying on the plane
S
. Vectors
3S
k k II
±±
= ±
are normal
to that plane. The length of the “wave vectors”
k
±
is equal to angular fre-
quency
ω
.
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:
( ) ( )
( )
( )
[ ]
( )
( ) ( )
( )
( )
[]
( )
0 30 3 0 30 3
0 30 3 0 30 3
exp exp exp
exp exp exp
S S S SS
S S S SS
F e Ih I t II r e Ih I t I II r
F e Ih I t II r e Ih I t I II r
ωω
ωω
+
−
=+ − ⋅=+ − ⋅
=+ + ⋅=+ ⋅
(3)
Then for arbitrary (real1) scalars
λ
and
µ
:
( )
() ()
()
33
0 30
ee e
SS SS
S
I II r I II r
It
F F e Ih
ω
λµ λ µ
−⋅ ⋅
+−
+=+ +
(4)
is solution of (4.2). The item in the second parenthesis is weighted linear com-
bination 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:
ee
Plane Plane
II
ϕϕ
λµ
++ −−
+
(5),
where
( )
( )
1
3
1
cos cos
2
S
t II r
ϕω
±−
= ⋅
,
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
0
0
33
22
33
3
2
3
sin cos
1 sin 1 sin
sin
1 sin
SS
Plane S B
SS
S
E
S
t II r t II r
II I
t II r t II r
t II r
I
t II r
ωω
ωω
ω
ω
±
⋅⋅
= +
+⋅+⋅
⋅
+
+⋅
The triple of unit value basis orthonormal bivectors
{ }
00
,,
SB E
II I
is com-
prised of the
S
I
bivector, dual to the propagation direction vector;
0
B
I
is dual
to initial vector of magnetic field;
0
E
I
is dual to initial vector of electric field.
1Remember, in the current theory scalars are real ones. “Complex” scalars have no sense.
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2198 Journal of Applied Mathematics and Physics
The expression (5) is linear combination of two geometric algebra states,
g-qubits.
Linear combination of the two equally weighted basic solutions of the Max-
well equation
F
+
and
F
−
,
FF
λµ
+−
+
with
1
λµ
= =
reads:
( )
00
1
3
11 1 1
2cos cos sin cos sin
22 2 2
S SB E
FF
II r tI tI tI t
λµ
λµ
ω ωω ω ω
+−
= =
+
= ⋅ ++ +
(6)
where
1
cos cos
2t
ϕω
=
and
( )
2
1
sin 1 sin
2t
ϕω
= +
. It can be written in
standard exponential form
cos sin e B
I
B
I
ϕ
ϕϕ
+=
.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
( )
S
I
αβ
+
[4], on an observable
C
:
( ) ( ) ( )
()
SSS S
ICI ICI
αβαβαβαβ
− +=+ +
Take as first example the case of observable as a vector expanded in
{ }
{ }
00
3 3 3 123
, , ,,
SB E
II II II e e e≡
, basis vectors dual to bivectors
{ }
00
,,
SB E
II I
:
11 2 2 33
C ce c e c e=++
Measure it with wave function (6):
()
()
( )
( )
00
00
00
00
2
3
2
3
13 23 33
11 1 1
4cos cos sin cos sin
22 2 2
1 1 11
cos sin cos sin
2 2 22
2cos cos sin cos sin
cos
S SB E
SB E
S SB E
SB E
II r tI tI tI t
C tI tI t I t
II r tI tI tI t
cII cII cII t
ω ωω ω ω
ωω ω ω
ω ωω ω ω
ω
⋅ −− −
× ++ +
= ⋅ −− −
×+ +
()
00
sin cos sin
SB E
I tI tI t
ωωω
++ +
The result is:
( )
( ) ( )
2
3 31 1 2 2 2 1 3
4 cos sin 2 cos 2 sin 2 co s 2
S
II r ce c t c te c t c te
ω ω ω ωω
⋅+ + + −
Geometrically that means that the measured vector is rotated by
2
π
in the
0
B
I
plane, such that the
33
ce
component becomes orthogonal to plane
S
I
and remains unchanged. Two other vector components became orthogonal to
0
B
I
and
0
E
I
and continue rotating in
S
I
with angular velocity
2t
ω
.
2Good to remember that the two basic solutions
F
+
and
F−
differ only by the sign of
3S
II
,
which is caused by orientation of
S
I
that in its turn defines if the triple
{ }
3
,,
ˆ ˆ
S
H IE I±
is right
-
hand screw or left-hand screw oriented.
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2199 Journal of Applied Mathematics and Physics
One another example of measurement is that of the g-qubit type observable
0 11 2 2 3 3
C CB C B C B
++ +
(actually Hopf fibration) by a state
11 2 2 33
BBB
αβ β β
++ +
[5]:
( ) ( )
( ) ( )
( )
( )
( ) ( )
( )
( )
( ) ( )
( ) ( )
( )
11 2 2 3 3
0 11 2 2 3 3 0
22 22
1 1 2 3 2 12 3 3 2 13 1
22 22
1 3 12 2 2 1 3 3 2 3 1 2
22 22
1 13 2 2 1 2 3 3 3 1 2 3
22
22
22
BBB
C CB C B C B C
C C CB
C C CB
C CC B
αβ β β
α β β β β β αβ αβ β β
αβ β β α β β β β β αβ
β β αβ αβ β β α β β β
++ +
++ +
+ +−+ + − + +
+ + + +−+ + −
+
− + + + +−+
→
with:
1S
BI=
,
0
2B
BI=
,
0
3E
BI=
,
( )
3
11
2cos cos
22
S
II r t
αω ω
= ⋅
,
( )
13
1
2cos sin
2
S
II r t
βω ω
= ⋅
,
( )
23
1
2cos cos
2
S
II r t
βω ω
= ⋅
,
( )
33
1
2cos sin
2
S
II r t
βω ω
= ⋅
gives a
3
G
+
element spreading through the three-dimensional space for all val-
ues of time parameter
t
:
( ) ( )
( )
0
0
2
3 03 1 3
21
4 cos sin 2 cos 2
sin 2 cos 2
SS B
E
II r C CI C t C t I
C t C tI
ω ωω
ωω
⋅ ++ +
+−
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
( )
,tr
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 in-
stants 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
()
2
33
4cos
S
II r c
ω
⋅
,
( )
( )
2
31 2
4 cos si n 2 cos 2
S
II r c t c t
ω ωω
⋅+
and
( )
( )
2
32 1
4 cos sin 2 cos 2
S
II r c t c 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)
{
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2200 Journal of Applied Mathematics and Physics
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 * (
c
1 sin(2 * omega *
t
) + c2 cos (2 * omega *
t
));
output[oidx][2] = oidx*tstep;
output[oidx][2] += factor * (
c
2 sin(2 * omega *
t
) + c1 cos (2 * omega *
t
));
}
template<typename T>
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);
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2201 Journal of Applied Mathematics and Physics
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 = cudaCreateChannel-
Desc<VolumeType>();
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;
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2202 Journal of Applied Mathematics and Physics
checkCudaErrors ( cudaMemcpy3D(©Params) );
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, cudaMemcpyDe-
viceToHost));
if (keyboard(key)==1)
exit(error);
}
return error;
}
The GPU CUDA case of simulation of measurement of a g-qubit type of ob-
servable 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;
}
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2203 Journal of Applied Mathematics and Physics
More flexibility in measurements can be achieved by scattering of the sprefield
wave function before applying to observables.
Arbitrary Clifford translation
()
00
12 3
e cos sin
BC
I
SB E
II I
γ
γ γγ γ γ
=+ ++
acting
on spreons (6) gives:
( ) ( )
( )
( )
0
3 12 3
1 23
12 3
12
1
2cos cos cos sin sin sin cos sin sin
2
1cos sin sin cos sin sin sin cos
2
1cos cos sin sin sin cos sin sin
2
1cos sin sin cos sin sin
2
S
S
B
II r t t t t
t t t tI
t t t tI
tt
ω γ ωγ γ ωγ γ ωγ γ ω
γ ωγ γ ωγ γ ωγ γ ω
γ ωγ γ ωγ γ ωγ γ ω
γ ωγ γ ωγ γ
⋅ −− −
+ +−+
++ −
++
+
−
( )
0
3
sin cos
E
t tI
ωγ γ ω
+
(7)
This result is defined for all values of
t
and
r
, in other words the result of Clif-
ford 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 dif-
ference for the state (7) because it is simultaneously redefined for all values of
t
.
The values of measurements
( )
00
0 1 2 3 123
, , , , , , , , , , , ,,
SB E
OC C C C I I I tr
γγ γ γ ω
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 demon-
stration 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 in-
creasing, 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 spe-
cial case
11
γ
=
and
23
0
γγ
= =
(Clifford translation acts in plane
S
I
). The
result is:
()
( ) ( )
( )
( )
( )
( )
00 1 23
0
0
0 1 2 3 12 3 1, 0
2
3 02 3
1 23
1 23
, , , , , , , , , , , ,,
4 cos sin 2 cos 2
sin 2 sin 2 cos 2
cos 2 sin 2 sin 2
SB E
SS
B
E
OC C C C I I I tr
II r C C C I
C t tC C I
C t tC C I
γ γγ
γγ γ γ ω
ω γγ
ω γω
ω γω
= = =
= ⋅+ +
++ +
+− + −
The only component of measurement, namely the one lying in plane
S
I
, does
not change with time. The
0
B
I
and
0
E
I
components do depend on the time of
measurement being modified forward and backward in time if Clifford transla-
tion 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
A. Soiguine
DOI:
10.4236/jamp.2023.118141 2204 Journal of Applied Mathematics and Physics
on sets of objects possessing an infinite number of degrees of freedom. The mul-
tithread GPUs bearing the CUDA language functionality allow to simultaneous-
ly 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 ap-
proaches.
Conflicts of Interest
The author declares no conflicts of interest regarding the publication of this pa-
per.
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 Ap-
plied 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. Lam-
bert Academic Publishing, Saarbrucken.