Skip to content

Instantly share code, notes, and snippets.

View Scinawa's full-sized avatar
🎯
Focusing

Alessandro Luongo Scinawa

🎯
Focusing
View GitHub Profile
@Scinawa
Scinawa / integerpartition.py
Created March 29, 2016 22:53
Integer Partition
# http://stackoverflow.com/questions/10244180/python-generating-integer-partitions (checked)
def accelAsc(n):
a = [0 for i in range(n + 1)]
k = 1
a[0] = 0
y = n - 1
while k != 0:
x = a[k - 1] + 1
k -= 1
while 2*x <= y:
@Scinawa
Scinawa / space_hhl.py
Created December 20, 2017 01:14
Space estimation for HHL
#!/usr/bin/python3
import matplotlib.pyplot as plt
import sys
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--nqubit", required=False, help="number of qubits", type=int)
parser.add_argument("--precision", required=False, default=32, type=int)