forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b9b0ada
commit 388410f
Showing
128 changed files
with
8,532 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import os | ||
from os import listdir | ||
from os.path import isfile, join | ||
from qiskit import QuantumCircuit | ||
|
||
|
||
def get_circuits_from_directory(directory): | ||
""" Return a list of QuantumCircuits from the files in the directory. | ||
The files are sorted by the number of lines in the file. """ | ||
|
||
# Check if the directory exists, if not raise an error | ||
if not os.path.exists(directory): | ||
raise ValueError(f'The directory {directory} does not exist') | ||
|
||
# Get all of the files in the directory | ||
files = [f for f in listdir(directory) if isfile(join(directory, f))] | ||
|
||
# Sort the files by the number of lines in the file | ||
files.sort(key=lambda f: sum(1 for line in open(join(directory, f)))) | ||
|
||
# Read the files and return the QuantumCircuits | ||
circuits = [] | ||
for file in files: | ||
with open(join(directory, file), 'r') as f: | ||
circuits.append(QuantumCircuit.from_qasm_str(f.read())) | ||
|
||
return circuits |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[2]; | ||
h q[0]; | ||
cx q[0],q[1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[3]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[4]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[5]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[6]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[7]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[8]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[9]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[10]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[11]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[12]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[13]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[14]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[15]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[16]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; | ||
cx q[0],q[15]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[17]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; | ||
cx q[0],q[15]; | ||
cx q[0],q[16]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[18]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; | ||
cx q[0],q[15]; | ||
cx q[0],q[16]; | ||
cx q[0],q[17]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[19]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; | ||
cx q[0],q[15]; | ||
cx q[0],q[16]; | ||
cx q[0],q[17]; | ||
cx q[0],q[18]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[20]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; | ||
cx q[0],q[15]; | ||
cx q[0],q[16]; | ||
cx q[0],q[17]; | ||
cx q[0],q[18]; | ||
cx q[0],q[19]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[21]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; | ||
cx q[0],q[15]; | ||
cx q[0],q[16]; | ||
cx q[0],q[17]; | ||
cx q[0],q[18]; | ||
cx q[0],q[19]; | ||
cx q[0],q[20]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[22]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; | ||
cx q[0],q[15]; | ||
cx q[0],q[16]; | ||
cx q[0],q[17]; | ||
cx q[0],q[18]; | ||
cx q[0],q[19]; | ||
cx q[0],q[20]; | ||
cx q[0],q[21]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
OPENQASM 2.0; | ||
include "qelib1.inc"; | ||
qreg q[23]; | ||
h q[0]; | ||
cx q[0],q[1]; | ||
cx q[0],q[2]; | ||
cx q[0],q[3]; | ||
cx q[0],q[4]; | ||
cx q[0],q[5]; | ||
cx q[0],q[6]; | ||
cx q[0],q[7]; | ||
cx q[0],q[8]; | ||
cx q[0],q[9]; | ||
cx q[0],q[10]; | ||
cx q[0],q[11]; | ||
cx q[0],q[12]; | ||
cx q[0],q[13]; | ||
cx q[0],q[14]; | ||
cx q[0],q[15]; | ||
cx q[0],q[16]; | ||
cx q[0],q[17]; | ||
cx q[0],q[18]; | ||
cx q[0],q[19]; | ||
cx q[0],q[20]; | ||
cx q[0],q[21]; | ||
cx q[0],q[22]; |
Oops, something went wrong.