Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions tools/Error and Power Calc/Benchmarks.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,20 @@ 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

Just counting Qbits is the first, quickest and easiest way to attempt to quantify a computer's performance. The design we are creating has eight.

## 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.
Expand All @@ -30,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
59 changes: 59 additions & 0 deletions tools/Error and Power Calc/Benchmarks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#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():
# 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
74 changes: 74 additions & 0 deletions tools/Error and Power Calc/Error_Calcs.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#For further explanation see Error_Theory.md

import Error_Cals.qasam as qasam
import time


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<len(tot):
gateErr0=[]
while j<len(tot[i]):
gateErr0.append(tot[i][j]-QErr[i][j])
j+=1
i+=1
gateErr.append(gateErr0)

return gateErr

def Qbit_err():
#need to figure out delay in qsam.
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):
#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

return q1,q2
3 changes: 3 additions & 0 deletions tools/Error and Power Calc/Error_Cals.qasam
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CNOT(params) q
cx q[0],q[1];
measure q -> c;
2 changes: 1 addition & 1 deletion tools/Error and Power Calc/Error_Theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Decoerance is a function that I expect to be of the form where t is time:
It is possible to get further orders, but I do not expect more.
A is going to be a combination of some constant error for each Qbit, as well as QC error. Thus A = QC+a. Due to the lack of single photon source, we will assume that a is small.
We measure this by preparing all the Qbits, holding them for a time, then measuring. We must take into account the time taken between measurements.
i.e, if we say it takes nu milliseconds to measure a Qbits and we measure them in order, the time for Qbit n (Tn) is Tn=t+(nu*n)
i.e, if we say it takes nu milliseconds to measure a Qbit and we measure them in order, the time for Qbit n (Tn) is Tn=t+(nu*n)
We will then determine the function for each individual Qbit and fit a curve, as well as apply other statistics as needed.
Lastly we will do the same for all Qbits.

Expand Down