ibm-quantum-challenge-fall-22 icon indicating copy to clipboard operation
ibm-quantum-challenge-fall-22 copied to clipboard

Lab 4 `evaluate_expectation` function `results` bug

Open HuangJunye opened this issue 3 years ago • 1 comments

In Lab 4, Calculate the ground state of H3+ section

# Define evaluate_expectation function
def evaluate_expectation(x):
    x = list(x)
    
    # Define estimator run parameters
    #### enter your code below ####
    job = # ----------- Enter your code here
    results = job.values[0]
    job_list.append(job)
    
    # Pass results back to callback function
    return np.real(results)

results = job.values[0] should be results = job.result().values[0]

HuangJunye avatar Nov 18 '22 10:11 HuangJunye

Relevant slack threads

  • https://qiskit.slack.com/archives/C0466L7D5CG/p1668406205037179
  • https://qiskit.slack.com/archives/C0466L7D5CG/p1668287417472589?thread_ts=1668285412.008629&cid=C0466L7D5CG

HuangJunye avatar Nov 18 '22 10:11 HuangJunye