From e3b0bbce241d8b3adc7e0047508b18b74f4c0461 Mon Sep 17 00:00:00 2001 From: anastasiaangelo <145339311+anastasiaangelo@users.noreply.github.com> Date: Thu, 30 May 2024 11:30:14 +0200 Subject: [PATCH] gorund state rep --- Ising_mixerXY.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Ising_mixerXY.py b/Ising_mixerXY.py index 2f335f3f..5829b2f1 100644 --- a/Ising_mixerXY.py +++ b/Ising_mixerXY.py @@ -10,7 +10,7 @@ from copy import deepcopy num_rot = 2 -file_path = "RESULTS/XY-QAOA/5res-2rot.csv" +file_path = "RESULTS/XY-QAOA/10res-2rot.csv" file_path_depth = "RESULTS/Depths/XY-QAOA/4res-2rot.csv" ########################### Configure the hamiltonian from the values calculated classically with pyrosetta ############################ @@ -336,7 +336,7 @@ def calculate_bitstring_energy(bitstring, hamiltonian, backend=None): sorted_bitstrings = sorted(all_bitstrings.items(), key=lambda x: x[1]['energy']) -ground_state_repetition = sorted_bitstrings[0][1]['index'] +# ground_state_repetition = sorted_bitstrings[0][1]['index'] print("Best Measurement:", best_measurement) print("Sorted Bitstrings: ") @@ -355,8 +355,9 @@ def calculate_bitstring_energy(bitstring, hamiltonian, backend=None): "Execution Time (seconds)": [elapsed_time1], "Number of qubits": [num_qubits], "shots": [options['shots']], - "Fraction of bitstrings that satisfy the Hamming constraint": [fraction_satisfying_hamming], - "Iteration Ground State": [ground_state_repetition] + "Fraction": [fraction_satisfying_hamming], + # "Iteration Ground State": [ground_state_repetition], + "Sorted Bitstrings": [sorted_bitstrings] } found = True break @@ -371,8 +372,9 @@ def calculate_bitstring_energy(bitstring, hamiltonian, backend=None): "Execution Time (seconds)": [elapsed_time1], "Number of qubits": [num_qubits], "shots": [options['shots']], - "Fraction of bitstrings that satisfy the Hamming constraint": [fraction_satisfying_hamming], - "Iteration Ground State": [ground_state_repetition] + "Fraction": [fraction_satisfying_hamming], + # "Iteration Ground State": [ground_state_repetition], + "Sorted Bitstrings": [sorted_bitstrings] } df = pd.DataFrame(data)