Skip to content

Commit

Permalink
Removes use of old qubits
Browse files Browse the repository at this point in the history
In part 2 of the hello many worlds tutorial we used some paulisum operations that were defined on qubits defined in part 1. This changes things so that the paulisums defined in part 2 use qubits from part 2. Fixes tensorflow#467
  • Loading branch information
MichaelBroughton authored Feb 5, 2021
1 parent 64b1efa commit b29aca8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/tutorials/hello_many_worlds.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -920,11 +920,11 @@
" full_circuit,\n",
" {s:v for (s,v) in zip(control_params, params_to_prepare_output[index])}\n",
" ).final_state_vector\n",
" expectation = z0.expectation_from_state_vector(state, {qubit: 0}).real\n",
" expt = cirq.Z(qubit).expectation_from_state_vector(state, {qubit: 0}).real\n",
" print(f'For a desired output (expectation) of {desired_values[index]} with'\n",
" f' noisy preparation, the controller\\nnetwork found the following '\n",
" f'values for theta: {params_to_prepare_output[index]}\\nWhich gives an'\n",
" f' actual expectation of: {expectation}\\n')\n",
" f' actual expectation of: {expt}\\n')\n",
"\n",
"\n",
"check_error(commands, expected_outputs)"
Expand Down

0 comments on commit b29aca8

Please sign in to comment.