Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove qubits as an input from TomographyExperiment #896

Merged
merged 3 commits into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions pyquil/operator_estimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ class TomographyExperiment:

def __init__(self,
settings: Union[List[ExperimentSetting], List[List[ExperimentSetting]]],
program: Program,
qubits: List[int]):
program: Program):
if len(settings) == 0:
settings = []
else:
Expand All @@ -283,7 +282,6 @@ def __init__(self,

self._settings = settings # type: List[List[ExperimentSetting]]
self.program = program
self.qubits = qubits

def __len__(self):
return len(self._settings)
Expand Down Expand Up @@ -359,7 +357,6 @@ def serializable(self):
'type': 'TomographyExperiment',
'settings': self._settings,
'program': self.program.out(),
'qubits': self.qubits,
}

def __eq__(self, other):
Expand Down Expand Up @@ -393,8 +390,7 @@ def _operator_object_hook(obj):
if 'type' in obj and obj['type'] == 'TomographyExperiment':
return TomographyExperiment([[ExperimentSetting.from_str(s) for s in settings]
for settings in obj['settings']],
program=Program(obj['program']),
qubits=obj['qubits'])
program=Program(obj['program']))
return obj


Expand Down Expand Up @@ -536,7 +532,7 @@ def group_experiments_clique_removal(experiments: TomographyExperiment) -> Tomog

new_cliqs += [new_cliq]

return TomographyExperiment(new_cliqs, program=experiments.program, qubits=experiments.qubits)
return TomographyExperiment(new_cliqs, program=experiments.program)


def _max_weight_operator(ops: Iterable[PauliTerm]) -> Union[None, PauliTerm]:
Expand Down Expand Up @@ -642,8 +638,7 @@ def group_experiments_greedy(tomo_expt: TomographyExperiment):
"""
diag_sets = _max_tpb_overlap(tomo_expt)
grouped_expt_settings_list = list(diag_sets.values())
grouped_tomo_expt = TomographyExperiment(grouped_expt_settings_list, program=tomo_expt.program,
qubits=tomo_expt.qubits)
grouped_tomo_expt = TomographyExperiment(grouped_expt_settings_list, program=tomo_expt.program)
return grouped_tomo_expt


Expand Down
Loading