Ejemplo n.º 1
0
 def test_state_setter(self):
     provider = IBMQ.load_account()
     backend = QiskitBitGenerator.get_best_backend(provider)
     bitgen = QiskitBitGenerator()
     bitgen.state = {}
     assert bitgen.state == QiskitBitGenerator().state
     bitgen.state = {"backend_filter": lambda b: True}
     bitgen.state = {"max_bits_per_request": 400}
     assert bitgen.state["job_config"]["max_bits_per_request"] == 400
     bitgen.state = {"backend": backend}
     assert not bitgen.state["backend_config"]["simulator"]
     bitgen.state = {"provider": provider}
     assert not bitgen.state["backend_config"]["simulator"]
Ejemplo n.º 2
0
 def test_job_partition(self):
     bitgen = QiskitBitGenerator()
     assert bitgen._job_partition == (24, 65536, 1)
     bitgen.state = {"max_bits_per_request": 4}
     assert bitgen._job_partition == (4, 1, 1)