Skip to content

Commit

Permalink
gorund state rep
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiaangelo committed May 30, 2024
1 parent 7fac90a commit e3b0bbc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Ising_mixerXY.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ############################
Expand Down Expand Up @@ -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: ")
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit e3b0bbc

Please sign in to comment.