Skip to content

Commit

Permalink
Chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasM937 committed Dec 29, 2023
1 parent c740a48 commit a12cc51
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
29 changes: 29 additions & 0 deletions src/mail_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import smtplib


def main():
smtp_obj = smtplib.SMTP('smtp.mail.me.com', 587)
smtp_obj.starttls()
smtp_obj.login('[email protected]', 'zFak-1903-PinGirEis')

pairs = {'name_1': '[email protected]', 'name_2': '[email protected]'}

try:
for name in pairs.keys():
msg = ('From: {}\r\nTo: {}\r\n\r\nHi, {}'.format(smtp_obj.user,
pairs.get(name),
name))

print('Sending email to {} at {}...'.format(name, pairs.get(name)))

send_status = smtp_obj.sendmail(from_addr=smtp_obj.user,
to_addrs=pairs.get(name),
msg=msg)

if send_status != {}:
print('There was a problem sending mail to {}.\n{}'.format(name, send_status))
finally:
smtp_obj.quit()

if __name__ == '__main__':
main()
18 changes: 10 additions & 8 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import argparse
import pathlib


from test import *

from qiskit import QuantumCircuit
Expand Down Expand Up @@ -37,6 +36,8 @@ def __init__(self, id, name, receiver):

parser.add_argument('-t', '--test', action='store_true',
help='The run is only for testing purposes.')
parser.add_argument('-s','--shots', type=int, default=4096,
help='How often should the measurment be executed')
parser.add_argument('-vo','--validate_off', action='store_true',
help='Disable the validation. I advise against it but I\'m not your mum')
parser.add_argument('-ll','--loop_lebel', choices=range(1,5), default=2,
Expand All @@ -54,11 +55,13 @@ def __init__(self, id, name, receiver):

if not args.backend:
args.test = True
else:
backend_str = args.backend

if args.test:
backend = 'ibmq_qasm_simulator'
backend_str = 'ibmq_qasm_simulator'

print(args.test, args.backend)
shots = args.shots

try:
config_file = open(args.config_path)
Expand All @@ -76,20 +79,19 @@ def __init__(self, id, name, receiver):
raise ValueError('No provider_token, configure config.json or use the CLI argument.')

provider = IBMProvider(token=provider_token)
backend = provider.get_backend(backend_str)

num_participants = len(config_data['Participants'])
num_qbits = math.ceil(math.log2(num_participants**2))

qc = QuantumCircuit(num_qbits, num_qbits)
for i in range(num_qbits):
qc.h(i)

qc.measure(list(range(num_qbits)), list(range(num_qbits)))

#TODO: Add CLI cmd to change this - simulator == -t / --test
backend = provider.get_backend('ibmq_qasm_simulator')
#TODO: Add CLI cmd to change this - also to split it up, to make retries less costly.
shots = 512
if args.verbose:
print(qc)

transpiled_circuit = transpile(qc, backend)

Expand Down

0 comments on commit a12cc51

Please sign in to comment.