Skip to content

Sampler.__init__() got an unexpected keyword argument 'options' #303

@s110m

Description

@s110m

I tried to run the following cell in sec1_basic.ipynb:

from torchquantum.plugin.qiskit.qiskit_plugin import tq2qiskit
from torchquantum.plugin.qiskit.qiskit_processor import QiskitProcessor

processor = QiskitProcessor(use_real_qc=False, ibm_quantum_token='token', max_jobs=1)
circ = tq2qiskit(q_dev, model)
circ.measure_all()

res = processor.process_ready_circs(q_dev, [circ])

# this is the expectation value
print(res)

However, I got the following error related to torchquantum\plugin\qiskit\qiskit_processor.py:

self.sampler = AerSampler(options={"backend_options": backend_opts}, seed=self.seed_simulator)
# self.sampler = AerSampler(backend_options=backend_opts, seed=self.seed_simulator)
logger.info(f"Initialized AerSampler.{' With noise model.' if self.noise_model else ''}")

Error message:

TypeError: Sampler.__init__() got an unexpected keyword argument 'options'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions