Skip to content

Commit

Permalink
fix basic inputs for distribution reconstruction
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopesculian committed Oct 7, 2024
1 parent d00baf5 commit b026037
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion qiskit_addon_cutting/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@
PartitionedCuttingProblem,
)
from .cutting_experiments import generate_cutting_experiments
from .cutting_reconstruction import reconstruct_expectation_values
from .cutting_reconstruction import (
reconstruct_expectation_values,
reconstruct_distribution,
)
from .wire_cutting_transforms import cut_wires, expand_observables
from .automated_cut_finding import find_cuts, DeviceConstraints, OptimizationParameters

Expand All @@ -104,6 +107,7 @@
"cut_gates",
"generate_cutting_experiments",
"reconstruct_expectation_values",
"reconstruct_distribution",
"PartitionedCuttingProblem",
"cut_wires",
"expand_observables",
Expand Down
8 changes: 4 additions & 4 deletions qiskit_addon_cutting/cutting_decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ def partition_problem(
if observables is not None and any(obs.phase != 0 for obs in observables):
raise ValueError("An input observable has a phase not equal to 1.")

if len(circuit.cregs) != 0 or circuit.num_clbits != 0:
raise ValueError(
"Circuits input to partition_problem should contain no classical registers or bits."
)
# if len(circuit.cregs) != 0 or circuit.num_clbits != 0:
# raise ValueError(
# "Circuits input to partition_problem should contain no classical registers or bits."
# )

# Determine partition labels from connectivity (ignoring TwoQubitQPDGates)
# if partition_labels is not specified
Expand Down
2 changes: 1 addition & 1 deletion qiskit_addon_cutting/cutting_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

def generate_cutting_experiments(
circuits: QuantumCircuit | dict[Hashable, QuantumCircuit],
observables: PauliList | dict[Hashable, PauliList],
observables: PauliList | dict[Hashable, PauliList] | None,
num_samples: int | float,
) -> tuple[
list[QuantumCircuit] | dict[Hashable, list[QuantumCircuit]],
Expand Down

0 comments on commit b026037

Please sign in to comment.