Skip to content

Commit

Permalink
Further edits for Add code examples PR (Qiskit#1339)
Browse files Browse the repository at this point in the history
  • Loading branch information
beckykd authored May 10, 2024
1 parent cecb322 commit 8ccb76c
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions docs/run/primitives-examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,6 @@ service = QiskitRuntimeService()
backend = service.least_busy(operational=True, simulator=False)
estimator = Estimator(backend)

estimator = Estimator(backend)

pm = generate_preset_pass_manager(backend=backend, optimization_level=1)
chsh_isa_circuit = pm.run(chsh_circuit)
isa_observables = [operator.apply_layout(chsh_isa_circuit.layout) for operator in ops]
Expand All @@ -250,8 +248,6 @@ isa_observables = [operator.apply_layout(chsh_isa_circuit.layout) for operator i
reshaped_ops = np.fromiter(isa_observables, dtype=object)
reshaped_ops = reshaped_ops.reshape((4, 1))

from qiskit_ibm_runtime import EstimatorV2 as Estimator

estimator = Estimator(backend, options={"default_shots": int(1e4)})
job = estimator.run([(chsh_isa_circuit, reshaped_ops, individual_phases)])
# Get results for the first (and only) PUB
Expand Down Expand Up @@ -468,16 +464,13 @@ from qiskit_ibm_runtime import QiskitRuntimeService

service = QiskitRuntimeService()
backend = service.least_busy(operational=True, simulator=False, min_num_qubits=127)
estimator = Estimator(backend)

n_qubits = 127

mat = np.real(random_hermitian(n_qubits, seed=1234))
circuit = IQP(mat)
circuit.measure_all()

from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager

pm = generate_preset_pass_manager(backend=backend, optimization_level=1)
isa_circuit = pm.run(circuit)

Expand Down Expand Up @@ -637,7 +630,6 @@ from qiskit_ibm_runtime import QiskitRuntimeService

service = QiskitRuntimeService()
backend = service.least_busy(operational=True, simulator=False, min_num_qubits=127)
estimator = Estimator(backend)

pm = generate_preset_pass_manager(backend=backend, optimization_level=1)
isa_circuit = pm.run(circuit)
Expand Down Expand Up @@ -725,7 +717,6 @@ pm = generate_preset_pass_manager(backend=backend, optimization_level=1)
isa_circuit = pm.run(circuit)
another_isa_circuit = pm.run(another_circuit)

#with Session(service=service, backend=backend) as session:
with Session(backend=backend) as session:
sampler = Sampler(session=session)
job = sampler.run([isa_circuit])
Expand Down

0 comments on commit 8ccb76c

Please sign in to comment.