Skip to content

Commit

Permalink
Reorganized files
Browse files Browse the repository at this point in the history
  • Loading branch information
henryzou50 committed Feb 27, 2024
1 parent 388410f commit c0241a4
Show file tree
Hide file tree
Showing 135 changed files with 348 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@

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. """
The files are sorted by the number of lines in the file.
Args:
directory (str): The path to the directory containing the files.
Returns:
list[QuantumCircuit]: The QuantumCircuits from the files in the directory.
"""

# Check if the directory exists, if not raise an error
if not os.path.exists(directory):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from qiskit.transpiler import CouplingMap
import os
import ast

def file_to_coupling_map(file_path):
""" Converts a file to a coupling map.
Args:
file_path (str): The path to the file to convert.
Returns:
CouplingMap: The coupling map from the file.
"""
with open(file_path, 'r') as f:
content = f.read().strip()
return CouplingMap(ast.literal_eval(content))
162 changes: 162 additions & 0 deletions workspace_experiments/experiment_setup/generate_ghz.ipynb

Large diffs are not rendered by default.

115 changes: 115 additions & 0 deletions workspace_experiments/experiment_setup/test_coupling_maps.ipynb

Large diffs are not rendered by default.

48 changes: 48 additions & 0 deletions workspace_experiments/experiment_setup/test_pass_managers.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"This notebook tests how we will generate pass managers for each transpilation. "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"from circuits.circuit_files import get_circuits_from_directory"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "qiskit-dev",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
File renamed without changes.

0 comments on commit c0241a4

Please sign in to comment.