In Grovers Example i am not able to distrubuted over multipal cpu , can you please add more details about QuESTEnv env = createQuESTEnv(); #556
Replies: 4 comments
-
Hi Ketan, Could you share the Let me know if this solves it! |
Beta Was this translation helpful? Give feedback.
-
ok so basic tutorial .c example when i run i got multiple print statements
so i can overcome them using set (env.rank==0)
(Quest_mpi) ***@***.*** examples]$ mpiicx tutorial_example.c -o ketan
-lQuEST -lm
(Quest_mpi) ***@***.*** examples]$ export OMP_NUM_THREADS=16
(Quest_mpi) ***@***.*** examples]$ mpirun -np 8 ./ketan
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
This is our environment:
Circuit output:
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
This is our environment:
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
Circuit output:
This is our environment:
This is our environment:
QUBITS:
Number of qubits is 10.
Number of amps is 1024.
Number of amps per rank is 128.
EXECUTION ENVIRONMENT:
Running distributed (MPI) version
Number of ranks is 8
OpenMP enabled
Number of threads available is 16
Precision: size of qreal is 8 bytes
Circuit output:
Circuit output:
This is our environment:
This is our environment:
This is our environment:
This is our environment:
Circuit output:
Circuit output:
Circuit output:
Probability amplitude of |111>: 0.11242178332663
Circuit output:
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
now talk about grovers example
mpiicx grovers_search.c -o ketan -lQuEST -lm
(Quest_mpi) ***@***.*** examples]$ export OMP_NUM_THREADS=16
(Quest_mpi) ***@***.*** examples]$ mpirun -np 8 ./ketan
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
this one is not distrubuted
Ketan More
Software Engineer and Developer
[image: email] ***@***.*** [image: mobile] 9834930302
[image: address] Pune Maharashtra [image: website]
https://flowcv.me/ketanmore-137
[image: linkedIn] <https://www.linkedin.com/in/ketan-more-6a36a41b3/> [image:
github] <https://github.com/ketan-more-github> [image: facebook]
<https://www.facebook.com/ketan.more.3910> [image: instagram]
<https://www.instagram.com/ketuzz.137/>
Create your own free signature here
<https://flowcv.com/?ref=email-signature>
…On Thu, 6 Mar 2025 at 18:40, Tyson Jones ***@***.***> wrote:
Hi Ketan,
Could you share the mpirun command you're trying? As noted here
<https://github.com/QuEST-Kit/QuEST/tree/master/examples#running>, QuEST
can only be *distributed* over a power-of-2 number of nodes (e.g. 2, 4, 16,
64, ...). Alas in v3 you're using, I think there is regrettably no error
message when trying an invalid configuration - just a seg-fault, or
something. We've addressed this in the imminent v4 which will have better
doc.
Let me know if this solves it!
—
Reply to this email directly, view it on GitHub
<#556 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXZ3MB3CLE2Q3IA24JUAHGL2TBCNLAVCNFSM6AAAAABYN5CA2WVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENBRGQYDINA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
what i am thinking
for (int r=0; r<numReps; r++) {
applyOracle(qureg, numQubits, solElem);
applyDiffuser(qureg, numQubits);
// monitor the probability of the solution state
printf("prob of solution |%d> = " REAL_STRING_FORMAT "\n",
solElem, getProbAmp(qureg, solElem));
}
i have this loop so this 2 function apply oracle and apply diffuser
should be run on different cpu distributed num of cpu == num of reps and
thn each cpu return back probability is this working internally??
Ketan More
Software Engineer and Developer
[image: email] ***@***.*** [image: mobile] 9834930302
[image: address] Pune Maharashtra [image: website]
https://flowcv.me/ketanmore-137
[image: linkedIn] <https://www.linkedin.com/in/ketan-more-6a36a41b3/> [image:
github] <https://github.com/ketan-more-github> [image: facebook]
<https://www.facebook.com/ketan.more.3910> [image: instagram]
<https://www.instagram.com/ketuzz.137/>
Create your own free signature here
<https://flowcv.com/?ref=email-signature>
…On Fri, 7 Mar 2025 at 10:55, Ketan More ***@***.***> wrote:
ok so basic tutorial .c example when i run i got multiple print
statements so i can overcome them using set (env.rank==0)
(Quest_mpi) ***@***.*** examples]$ mpiicx tutorial_example.c -o ketan
-lQuEST -lm
(Quest_mpi) ***@***.*** examples]$ export OMP_NUM_THREADS=16
(Quest_mpi) ***@***.*** examples]$ mpirun -np 8 ./ketan
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
This is our environment:
Circuit output:
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
This is our environment:
-------------------------------------------------------
Running QuEST tutorial:
Basic circuit involving a system of 3 qubits.
-------------------------------------------------------
Circuit output:
This is our environment:
This is our environment:
QUBITS:
Number of qubits is 10.
Number of amps is 1024.
Number of amps per rank is 128.
EXECUTION ENVIRONMENT:
Running distributed (MPI) version
Number of ranks is 8
OpenMP enabled
Number of threads available is 16
Precision: size of qreal is 8 bytes
Circuit output:
Circuit output:
This is our environment:
This is our environment:
This is our environment:
This is our environment:
Circuit output:
Circuit output:
Circuit output:
Probability amplitude of |111>: 0.11242178332663
Circuit output:
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability amplitude of |111>: 0.11242178332663
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Probability of qubit 2 being in state 1: 0.74917785178177
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 0 was measured in state 0
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
Qubit 2 collapsed to 1 with probability 0.71771426119322
now talk about grovers example
mpiicx grovers_search.c -o ketan -lQuEST -lm
(Quest_mpi) ***@***.*** examples]$ export OMP_NUM_THREADS=16
(Quest_mpi) ***@***.*** examples]$ mpirun -np 8 ./ketan
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
numQubits: 3, numElems: 8, numReps: 3
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.78125000000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.94531250000000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
prob of solution |3> = 0.33007812500000
this one is not distrubuted
Ketan More
Software Engineer and Developer
[image: email] ***@***.*** [image: mobile] 9834930302
[image: address] Pune Maharashtra [image: website]
https://flowcv.me/ketanmore-137
[image: linkedIn] <https://www.linkedin.com/in/ketan-more-6a36a41b3/> [image:
github] <https://github.com/ketan-more-github> [image: facebook]
<https://www.facebook.com/ketan.more.3910> [image: instagram]
<https://www.instagram.com/ketuzz.137/>
Create your own free signature here
<https://flowcv.com/?ref=email-signature>
On Thu, 6 Mar 2025 at 18:40, Tyson Jones ***@***.***> wrote:
> Hi Ketan,
>
> Could you share the mpirun command you're trying? As noted here
> <https://github.com/QuEST-Kit/QuEST/tree/master/examples#running>, QuEST
> can only be *distributed* over a power-of-2 number of nodes (e.g. 2, 4,
> 16, 64, ...). Alas in v3 you're using, I think there is regrettably no
> error message when trying an invalid configuration - just a seg-fault, or
> something. We've addressed this in the imminent v4 which will have better
> doc.
>
> Let me know if this solves it!
>
> —
> Reply to this email directly, view it on GitHub
> <#556 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AXZ3MB3CLE2Q3IA24JUAHGL2TBCNLAVCNFSM6AAAAABYN5CA2WVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENBRGQYDINA>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
Hmm alas I'm not following - but thankfully the issue might be moot with the recently released v4. You can now use functions like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
when i am running grovers serch example using mpi compiled am not able to run this with multipal cpu
if i want update code using mpi. QuESTEnv env = createQuESTEnv(); can you add more details about this env
Beta Was this translation helpful? Give feedback.
All reactions