Skip to content

Commit

Permalink
Merge pull request #13 from vabarbosa/va-ghz-game
Browse files Browse the repository at this point in the history
Update GHZ game
  • Loading branch information
vabarbosa authored Oct 17, 2024
2 parents 7729814 + ea68eda commit 0bd98ed
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 317 deletions.
359 changes: 45 additions & 314 deletions GHZ-Game.ipynb

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions GHZGame/ghzGame.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit
from qiskit import execute, BasicAer
from qiskit import transpile
from qiskit.providers.basic_provider import BasicProvider
from random import randint

def Alice(AlicesColor, AlicesShape): global a_color; global a_shape; a_color=AlicesColor; a_shape = AlicesShape;
Expand Down Expand Up @@ -86,9 +87,10 @@ def yyx(qc, q):
return qc

def simulate(qc, q, c, s):
backend = BasicAer.get_backend('qasm_simulator') # define the backend
backend = BasicProvider().get_backend('basic_simulator') # define the backend
qc.measure(q,c)
job = execute(qc, backend, shots=s) # run the job simulation
transpiled_circuit = transpile(qc, backend)
job = backend.run(transpiled_circuit, shots=s) # run the job simulation
result = job.result() # grab the result
counts = result.get_counts(qc) # results for the number of runs
return counts
Expand Down

0 comments on commit 0bd98ed

Please sign in to comment.