def test_vqe_mes(self):
        """ Test VQEUCCSDFactory with QEOM """
        solver = VQEUCCFactory(self.quantum_instance)
        gsc = GroundStateEigensolver(self.qubit_converter, solver)
        esc = QEOM(gsc, 'sd')
        results = esc.solve(self.electronic_structure_problem)

        for idx in range(len(self.reference_energies)):
            self.assertAlmostEqual(results.computed_energies[idx], self.reference_energies[idx],
                                   places=4)
    def test_numpy_mes(self):
        """ Test NumPyMinimumEigenSolver with QEOM """
        solver = NumPyMinimumEigensolver()
        gsc = GroundStateEigensolver(self.qubit_converter, solver)
        esc = QEOM(gsc, 'sd')
        results = esc.solve(self.electronic_structure_problem)

        for idx in range(len(self.reference_energies)):
            self.assertAlmostEqual(results.computed_energies[idx], self.reference_energies[idx],
                                   places=4)
示例#3
0
    def test_vqe_mes(self):
        """ Test VQEUCCSDFactory with QEOM """
        solver = VQEUCCSDFactory(self.quantum_instance)
        gsc = GroundStateEigensolver(self.transformation, solver)
        esc = QEOM(gsc, 'sd')
        results = esc.solve(self.driver)

        for idx in range(len(self.reference_energies)):
            self.assertAlmostEqual(results.computed_energies[idx], self.reference_energies[idx],
                                   places=4)
示例#4
0
    def test_numpy_mes(self):
        """ Test NumPyMinimumEigenSolver with QEOM """
        solver = NumPyMinimumEigensolver()
        gsc = GroundStateEigensolver(self.transformation, solver)
        esc = QEOM(gsc, 'sd')
        results = esc.solve(self.driver)

        for idx in range(len(self.reference_energies)):
            self.assertAlmostEqual(results.computed_energies[idx], self.reference_energies[idx],
                                   places=4)
    def test_numpy_mes(self):
        """ Test with NumPyMinimumEigensolver """
        solver = NumPyMinimumEigensolverFactory(use_default_filter_criterion=True)
        gsc = GroundStateEigensolver(self.qubit_converter, solver)
        esc = QEOM(gsc, 'sd')
        results = esc.solve(self.vibrational_problem)

        for idx in range(len(self.reference_energies)):
            self.assertAlmostEqual(results.computed_vibrational_energies[idx],
                                   self.reference_energies[idx],
                                   places=4)
 def test_vqe_uvccsd_factory(self):
     """ Test with VQE plus UVCCSD """
     optimizer = COBYLA(maxiter=5000)
     solver = VQEUVCCFactory(QuantumInstance(BasicAer.get_backend('statevector_simulator')),
                             optimizer=optimizer)
     gsc = GroundStateEigensolver(self.qubit_converter, solver)
     esc = QEOM(gsc, 'sd')
     results = esc.solve(self.vibrational_problem)
     for idx in range(len(self.reference_energies)):
         self.assertAlmostEqual(results.computed_vibrational_energies[idx],
                                self.reference_energies[idx],
                                places=1)