From 331bb530c3bddb0546c48101d2df7842dd245c9d Mon Sep 17 00:00:00 2001 From: InfamousPlatypus <45645300+InfamousPlatypus@users.noreply.github.com> Date: Fri, 11 Mar 2022 13:51:46 -0500 Subject: [PATCH 1/7] Update Benchmarks.md Added theoretical CLOPS --- tools/Error and Power Calc/Benchmarks.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/Error and Power Calc/Benchmarks.md b/tools/Error and Power Calc/Benchmarks.md index 547aaf3..c1d9f10 100644 --- a/tools/Error and Power Calc/Benchmarks.md +++ b/tools/Error and Power Calc/Benchmarks.md @@ -17,9 +17,11 @@ Just counting Qbits is the first, quickest and easiest way to attempt to quantif ## CLOPS ## See question #25 on GitHub +## ~60,000 CLOPS -CLOPS stands for Circuit Level Operations per Second. In other words, how many gates can be executed a second. Yes, this is hertz. This is probably to distinguish between the computer's speed and the frequencies needed to communicate with the qbit. -The maximum CLOPS will be determined by the slowest part in our gate and controller setup. The question has been raised on GitHub, question #25. +CLOPS stands for Circuit Level Operations per Second. In other words, how many gates can be executed a second. Yes, this is hertz. This is probably to distinguish between the computer's speed and the frequencies needed to communicate with some types of qbit. +The maximum CLOPS will be determined by the slowest part in our gate and controller setup. + ~60,000 CLOPS is attainable. As always, your particular build may be diffrent. ## Quantum Volume ## Depends on build. Benchmarking software in progress. From ff022d3c98ace4d4557d20038c43df82c0ca03c2 Mon Sep 17 00:00:00 2001 From: InfamousPlatypus <45645300+InfamousPlatypus@users.noreply.github.com> Date: Fri, 11 Mar 2022 10:53:33 -0800 Subject: [PATCH 2/7] Created Error Calcs programs Error calculations started. Need to implement most. --- tools/Error and Power Calc/Error_Calcs.py | 52 +++++++++++++++++++++ tools/Error and Power Calc/Error_Cals.qasam | 3 ++ 2 files changed, 55 insertions(+) create mode 100644 tools/Error and Power Calc/Error_Calcs.py create mode 100644 tools/Error and Power Calc/Error_Cals.qasam diff --git a/tools/Error and Power Calc/Error_Calcs.py b/tools/Error and Power Calc/Error_Calcs.py new file mode 100644 index 0000000..42af547 --- /dev/null +++ b/tools/Error and Power Calc/Error_Calcs.py @@ -0,0 +1,52 @@ +#For further explanation see Error_Theory.md + +import Error_Cals.qasam as qasam +import time + + +def qc_err(): + return NotImplementedError + +def gate_err(): + return NotImplementedError + +def Qbit_err(): + return NotImplementedError + +def total_err(q, runs): + #This should do. I don't know how communication with the qbits will be worked out. Will watch. + #I'll need to implement the timing. + total_err=[] + for i in q: + line_err=[] + for j in q: + #If the qbits are the same..... + if i == j: + line_err.append(-1) + #....We append -1 + + #If they are diffrent... + else: + k=0 + wrong=0 + #....We run a lot of CNOTS and do our error calculation + while k<=runs: + Class=CNOT(i,j) #we know Class is right. + Quant=qasam.CNOT(i,j) #Quant will have the errors + + if Class != Quant: + wrong +=1 + + k+=1 + line_err.append((wrong/runs)*100) + + total_err.append(line_err) + + return total_err + + +def CNOT(q1,q2): + if q1==True: + q2= not q2 + + return q1,q2 \ No newline at end of file diff --git a/tools/Error and Power Calc/Error_Cals.qasam b/tools/Error and Power Calc/Error_Cals.qasam new file mode 100644 index 0000000..ba7a18a --- /dev/null +++ b/tools/Error and Power Calc/Error_Cals.qasam @@ -0,0 +1,3 @@ +CNOT(params) q + cx q[0],q[1]; + measure q -> c; \ No newline at end of file From 0165f99a096de9c033de3407e734a7508fd1d788 Mon Sep 17 00:00:00 2001 From: InfamousPlatypus <45645300+InfamousPlatypus@users.noreply.github.com> Date: Tue, 12 Apr 2022 08:58:54 -0400 Subject: [PATCH 3/7] Added function for Gate error. fixed a spelling in the Error_Theory.md --- tools/Error and Power Calc/Error_Calcs.py | 17 +++++++++++++++-- tools/Error and Power Calc/Error_Theory.md | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/Error and Power Calc/Error_Calcs.py b/tools/Error and Power Calc/Error_Calcs.py index 42af547..76c71b4 100644 --- a/tools/Error and Power Calc/Error_Calcs.py +++ b/tools/Error and Power Calc/Error_Calcs.py @@ -7,8 +7,21 @@ def qc_err(): return NotImplementedError -def gate_err(): - return NotImplementedError +def gate_err(q,runs): + tot=total_err(q,runs) + QErr=Qbit_err() + gateErr=[] + i=0 + j=0 + while i Date: Wed, 13 Apr 2022 09:25:18 -0400 Subject: [PATCH 4/7] Added comments. I think it's clear what I'm doing but I'm doing C++ habits so it may be a bit unclear. --- tools/Error and Power Calc/Error_Calcs.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/Error and Power Calc/Error_Calcs.py b/tools/Error and Power Calc/Error_Calcs.py index 76c71b4..bcde9f7 100644 --- a/tools/Error and Power Calc/Error_Calcs.py +++ b/tools/Error and Power Calc/Error_Calcs.py @@ -5,14 +5,21 @@ def qc_err(): + #Need to figure out delay in qsam return NotImplementedError def gate_err(q,runs): + #Gate error= total error - Qbit error for the gate. + #Run the functions required to get the errors needed. tot=total_err(q,runs) QErr=Qbit_err() + + #Setup the required variables gateErr=[] i=0 j=0 + + #Start the math. I think there is a easier way in python, but I'm mostly a C++ dev and so I'm used to just buildng the thing and python makes that easy anyway. while i Date: Wed, 13 Apr 2022 09:28:09 -0400 Subject: [PATCH 5/7] Oops, missed one. --- tools/Error and Power Calc/Error_Calcs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/Error and Power Calc/Error_Calcs.py b/tools/Error and Power Calc/Error_Calcs.py index bcde9f7..038b91d 100644 --- a/tools/Error and Power Calc/Error_Calcs.py +++ b/tools/Error and Power Calc/Error_Calcs.py @@ -67,6 +67,7 @@ def total_err(q, runs): def CNOT(q1,q2): + #Yah, this should be easy to see. Just implementiing a classical Cnot in as few lines of code as I can. if q1==True: q2= not q2 From 9673c4048d5b658ac53fbdfacf26e22bfe8343c3 Mon Sep 17 00:00:00 2001 From: InfamousPlatypus <45645300+InfamousPlatypus@users.noreply.github.com> Date: Wed, 13 Apr 2022 10:20:56 -0400 Subject: [PATCH 6/7] Benchmarking functions started. --- tools/Error and Power Calc/Benchmarks.py | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tools/Error and Power Calc/Benchmarks.py diff --git a/tools/Error and Power Calc/Benchmarks.py b/tools/Error and Power Calc/Benchmarks.py new file mode 100644 index 0000000..4372198 --- /dev/null +++ b/tools/Error and Power Calc/Benchmarks.py @@ -0,0 +1,27 @@ +#For further explanation see Benchmarks.md + + +import Error_Cals.qasam as qasam +import time + +def qbit_count(): + #hardcoding this in, would like to have this like a -h option. + return 8 + +def clops(): + #We want to count how many operations we can do per second. Thus we time how long it takes to do a basic gate, then do math to figure out how many can be done per second. + Start=time.clock() + #since all the gates are the same, any cnot should take the same time. + #TODO Should I do a lot of these and avg the times? + qasam.CNOT(0,1) + End=time.clock() + T=End-Start + F=1/T + return F + +def QV(): + + + + + return NotImplementedError \ No newline at end of file From ac2a8e2db197f04762dd40426885b37d5c9efd00 Mon Sep 17 00:00:00 2001 From: InfamousPlatypus <45645300+InfamousPlatypus@users.noreply.github.com> Date: Mon, 2 May 2022 07:52:22 -0400 Subject: [PATCH 7/7] Filled out outline for QV() Updated comment on IBM's most powerful computer in QV --- tools/Error and Power Calc/Benchmarks.md | 5 +++ tools/Error and Power Calc/Benchmarks.py | 40 +++++++++++++++++++++--- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/tools/Error and Power Calc/Benchmarks.md b/tools/Error and Power Calc/Benchmarks.md index c1d9f10..b563ae8 100644 --- a/tools/Error and Power Calc/Benchmarks.md +++ b/tools/Error and Power Calc/Benchmarks.md @@ -10,6 +10,8 @@ Quantum computing has the threefold difficulty of having low level assembly arch As an open source project, these quantum computers are not expected to be in the hands of Quantum physicist or developers, but rather experimenters and hobbyists. This makes documentation more critical than other quantum projects. This documentation will assist in fulfilling the Roadmap's Documentation success criteria. +The power of the quantum computer will be some combination of these, dependant on your application. + ## Qbit Count ### 8 Qbits @@ -32,3 +34,6 @@ First we take n Qbits, and implement the Heavy output Generation algorithm for i Last we find QV=2^(lastNToPass). A quick use of a calculator reveals that the theoretical maximum for our 8-qbit quantum computer is 2^8=256. This is quite a bit larger than IBM's most powerful computer with a quantum volume of 128. With a lack of data, a QV of zero is probably to be expected. Noise canceling, incresing CLOPS, and other hardware improvements should improve this. It's going to be a lot of work, but the existence of an affordable quantum computer is a great improvement! + +## Quantum Fidelity? +Figure this out \ No newline at end of file diff --git a/tools/Error and Power Calc/Benchmarks.py b/tools/Error and Power Calc/Benchmarks.py index 4372198..8b44838 100644 --- a/tools/Error and Power Calc/Benchmarks.py +++ b/tools/Error and Power Calc/Benchmarks.py @@ -20,8 +20,40 @@ def clops(): return F def QV(): - - - - + # This is going to be rough, The individual steps are going to take some work and there are 6. + # adapted from https://qiskit.org/textbook/ch-quantum-hardware/measuring-quantum-volume.html + # Need to do research for the details. yay + + QVseq=generateQVSeq() + IdealOut=simIdealOut() + HeavOut=calcHeavOut() + Noise=defineNoise() + GateFid=avgGateFidelity() + MaxDepth=calcMaxDepth() + return calcQuantVol() + + + +def generateQVSeq(): + + # qubit_lists: list of list of qubit subsets to generate QV circuits + qubit_lists = [[0,1,2],[0,1,2,3],[0,1,2,3,4],[0,1,2,3,4,5],[0,1,2,3,4,5,6],[0,1,2,3,4,5,6,7]] + # ntrials: Number of random circuits to create for each subset + ntrials = 100 + + #and here the function dies because I don't know what the qv_circuit is + return NotImplementedError + + +def simIdealOut(): + return NotImplementedError +def calcHeavOut(): + return NotImplementedError +def defineNoise(): + return NotImplementedError +def avgGateFidelity(): + return NotImplementedError +def calcMaxDepth(): + return NotImplementedError +def calcQuantVol(): return NotImplementedError \ No newline at end of file