File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -190,7 +190,8 @@ the code directly into the REPL, or paste the code in a file. See the documentat
190190[here](https://quantumai.google/reference/python/qsimcirq/QSimOptions) for Options 1
191191and 2 or [here](https://docs.nvidia.com/cuda/cuquantum/appliance/cirq.html) for Option 3.
192192Make sure to change ` xx` to 0 for Option 1, 1 for Option 2, or the number of GPUs for
193- Option 3.
193+ Option 3. For option 3, note that ` QSimOptions` has a ` disable_gpu` flag instead of a
194+ ` use_gpu` flag.
194195
195196` ` `
196197# Import Cirq and qsim
@@ -202,8 +203,10 @@ q0, q1 = cirq.LineQubit.range(2)
202203circuit = cirq.Circuit(cirq.H(q0), cirq.CX(q0, q1))
203204
204205# Instantiate a simulator that uses the GPU
205- # xx = 0 for Option 1, 1 for Option 2, or the number of GPUs for Option 3.
206- gpu_options = qsimcirq.QSimOptions(use_gpu=True, gpu_mode = xx, max_fused_gate_size=4)
206+ # Option 1 (mode=0) or Option 2 (mode=1)
207+ gpu_options = qsimcirq.QSimOptions(use_gpu=True, gpu_mode = mode, max_fused_gate_size=4)
208+ # Option 3 (number of GPUs = `num_gpus`)
209+ gpu_options = qsimcirq.QSimOptions(disable_gpu=False, gpu_mode = num_gpus, max_fused_gate_size=4)
207210qsim_simulator = qsimcirq.QSimSimulator(qsim_options=gpu_options)
208211
209212# Run the simulation
You can’t perform that action at this time.
0 commit comments