Пример #1
0
    def setUp(self):
        super().setUp()

        self.devices = []
        if self.args.device == 'simulator' or self.args.device == 'all':
            self.devices.append(ProjectQSimulator(wires=self.num_subsystems))
            self.devices.append(
                ProjectQSimulator(wires=self.num_subsystems, shots=20000000))
        if self.args.device == 'ibm' or self.args.device == 'all':
            ibm_options = pennylane.default_config['projectq.ibm']
            if "user" in ibm_options and "password" in ibm_options:
                self.devices.append(
                    ProjectQIBMBackend(wires=self.num_subsystems,
                                       use_hardware=False,
                                       num_runs=8 * 1024,
                                       user=ibm_options['user'],
                                       password=ibm_options['password']))
            else:
                self.devices.append(
                    ProjectQIBMBackend(wires=self.num_subsystems,
                                       use_hardware=False,
                                       num_runs=8 * 1024,
                                       user='******',
                                       password='******'))
        if self.args.device == 'classical' or self.args.device == 'all':
            self.devices.append(
                ProjectQClassicalSimulator(wires=self.num_subsystems))
    def setUp(self):
        super().setUp()

        self.devices = []
        if self.args.device == 'simulator' or self.args.device == 'all':
            self.devices.append(
                ProjectQSimulator(wires=self.num_subsystems, verbose=True))
        if self.args.device == 'ibm' or self.args.device == 'all':
            ibm_options = pennylane.default_config['projectq.ibm']
            if "user" in ibm_options and "password" in ibm_options:
                self.devices.append(
                    ProjectQIBMBackend(wires=self.num_subsystems,
                                       use_hardware=False,
                                       num_runs=8 * 1024,
                                       user=ibm_options['user'],
                                       password=ibm_options['password'],
                                       verbose=True))
            else:
                log.warning(
                    "Skipping test of the ProjectQIBMBackend device because IBM login credentials could not be found in the PennyLane configuration file."
                )
        if self.args.device == 'classical' or self.args.device == 'all':
            self.devices.append(
                ProjectQClassicalSimulator(wires=self.num_subsystems,
                                           verbose=True))
Пример #3
0
    def setUp(self):
        super().setUp()

        self.devices = []
        if self.args.device == 'simulator' or self.args.device == 'all':
            self.devices.append(ProjectQSimulator(wires=self.num_subsystems))
            self.devices.append(
                ProjectQSimulator(wires=self.num_subsystems, shots=20000000))
        if self.args.device == 'ibm' or self.args.device == 'all':
            self.devices.append(
                ProjectQIBMBackend(wires=self.num_subsystems,
                                   use_hardware=False,
                                   num_runs=8 * 1024,
                                   token=token,
                                   verbose=True))
        if self.args.device == 'classical' or self.args.device == 'all':
            self.devices.append(
                ProjectQClassicalSimulator(wires=self.num_subsystems))