Skip to content

Commit

Permalink
Update docs remove print.
Browse files Browse the repository at this point in the history
  • Loading branch information
fdmalone committed Jul 2, 2024
1 parent 2de3d0f commit 2de5f1d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
10 changes: 8 additions & 2 deletions recirq/qcqmc/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ def _json_dict_(self):

@attrs.frozen(eq=False)
class OverlapAnalysisData(data.Data):
"""Container for analysis of overlap.
"""Container for storing the (shadow tomography-)reconstructed wavefunctions.
See the factory method `build_analysis_from_dependencies` which will
properly construct this object from the (real or simulated) experimental bitstrings.
Args:
params: The parameters for overlap construction.
Expand All @@ -92,6 +95,9 @@ def build_analysis_from_dependencies(
) -> "OverlapAnalysisData":
"""Builds a OverlapAnalysisData from OverlapAnalysisParams.
Given the sampled bitstrings from either a real experiment or a
simulated experiment, this will construct the shadow wavefunction.
Args:
params: The parameters for overlap analysis.
dependencies: The dependencies leading up to this point (i.e. the
Expand Down Expand Up @@ -134,7 +140,7 @@ def get_variational_energy(
hamiltonian_data: hamiltonian.HamiltonianData,
k: Union[str, int] = 1,
) -> float:
"""Gets the variational energy of the reconstructed wavefunction.
"""Computes the variational energy of the reconstructed wavefunction.
Args:
analysis_data: The overlap analysis data.
Expand Down
9 changes: 0 additions & 9 deletions recirq/qcqmc/analysis_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,6 @@ def test_small_experiment_partition_match_reversed_partition_same_seed(
k=1,
)

print(energy_1)
print(energy_2)
print(trial_wf.ansatz_energy)
print(trial_wf.ansatz_energy - energy_1)
print(trial_wf.ansatz_energy - energy_2)

print(analysis_1.reconstructed_wf_for_k["1"])
print(analysis_2.reconstructed_wf_for_k["1"])

assert np.abs(energy_1 - energy_2) < target_error


Expand Down

0 comments on commit 2de5f1d

Please sign in to comment.