Skip to content

Commit

Permalink
Add license blurbs
Browse files Browse the repository at this point in the history
  • Loading branch information
caleb-johnson committed Jan 9, 2024
1 parent 654ec7c commit 33c4096
Show file tree
Hide file tree
Showing 11 changed files with 128 additions and 12 deletions.
14 changes: 13 additions & 1 deletion circuit_knitting/cutting/cut_finding/best_first_search.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
"""File containing the classes required to implement Dijkstra's (best-first) search algorithm."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Classes required to implement Dijkstra's (best-first) search algorithm."""

import heapq
import numpy as np
from itertools import count
Expand Down
15 changes: 13 additions & 2 deletions circuit_knitting/cutting/cut_finding/circuit_interface.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
"""File containing the classes required to represent quantum circuits in a format
native to the circuit cutting optimizer."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Quantum circuit representation compatible with cut-finding optimizers."""

import copy
import string
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion circuit_knitting/cutting/cut_finding/cut_finding.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This code is a Qiskit project.

# (C) Copyright IBM 2023.
# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
Expand Down
14 changes: 13 additions & 1 deletion circuit_knitting/cutting/cut_finding/cut_optimization.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
""" File containing the classes required to search for optimal cut locations."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Classes required to search for optimal cut locations."""

import numpy as np
from .utils import selectSearchEngine, greedyBestFirstSearch
from .cutting_actions import disjoint_subcircuit_actions
Expand Down
16 changes: 14 additions & 2 deletions circuit_knitting/cutting/cut_finding/cutting_actions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
""" File containing classes needed to implement the actions involved in circuit cutting."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Classes needed to implement the actions involved in circuit cutting."""

import numpy as np
from abc import ABC, abstractmethod
from .search_space_generator import ActionNames

### This is an object that holds action names for constructing disjoint subcircuits
# Object that holds action names for constructing disjoint subcircuits
disjoint_subcircuit_actions = ActionNames()


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
"""File containing the class needed for representing search-space states when cutting circuits."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Class needed for representing search-space states when cutting circuits."""

import copy
import numpy as np
from collections import Counter, namedtuple
Expand Down
12 changes: 12 additions & 0 deletions circuit_knitting/cutting/cut_finding/lo_cuts_optimizer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""File containing the wrapper class for optimizing LO gate and wire cuts."""

from .cut_optimization import CutOptimization
from .cut_optimization import disjoint_subcircuit_actions
from .cut_optimization import CutOptimizationNextStateFunc
Expand Down
13 changes: 12 additions & 1 deletion circuit_knitting/cutting/cut_finding/optimization_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
"""File containing class for specifying parameters that control the optimization."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Class for specifying parameters that control the optimization."""


class OptimizationSettings:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
"""File containing the class used for specifying characteristics of the target QPU."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Class used for specifying characteristics of the target QPU."""


class DeviceConstraints:
Expand Down
13 changes: 12 additions & 1 deletion circuit_knitting/cutting/cut_finding/search_space_generator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
"""File containing the classes needed to generate and explore a search space."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Classes needed to generate and explore a search space."""


class ActionNames:
Expand Down
14 changes: 13 additions & 1 deletion circuit_knitting/cutting/cut_finding/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
"""File containing helper functions that are used in the code."""
# This code is a Qiskit project.

# (C) Copyright IBM 2024.

# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.

"""Helper functions that are used in the code."""

from qiskit import QuantumCircuit
from qiskit.circuit import Instruction
from .best_first_search import BestFirstSearch
Expand Down

0 comments on commit 33c4096

Please sign in to comment.