Giter VIP home page Giter VIP logo

qiskit-application-modules-demo-sessions's Introduction

qiskit-application-modules-demo-sessions's People

Contributors

a-matsuo avatar adekusar-drl avatar cryoris avatar garrison avatar huangjunye avatar julenl avatar mrossinek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qiskit-application-modules-demo-sessions's Issues

Add test suite (treon via GitHub Actions)

I believe this repository would benefit from having a test suite that evaluates each notebook using treon to check for any errors. Running this periodically would allow us to ensure that the code provided in these demos continues to work in future versions of Qiskit.

qiskit-application-modules-demo-sessions/qiskit-nature/Qiskit_Nature_YouTube_Tutorial.ipynb is broken

In [27] the code:

runtime_result = runtime_vqe_solver.solve(problem_reduced)

returns consistently:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-27-fb20d8ad77c2> in <module>
----> 1 runtime_result = runtime_vqe_solver.solve(problem_reduced)

~/work/Qiskit/qrel_env/lib/python3.8/site-packages/qiskit_nature/algorithms/ground_state_solvers/ground_state_eigensolver.py in solve(self, problem, aux_operators)
    144         raw_mes_result = self._solver.compute_minimum_eigenvalue(main_operator, aux_ops)
    145 
--> 146         result = problem.interpret(raw_mes_result)
    147         return result
    148 

~/work/Qiskit/qrel_env/lib/python3.8/site-packages/qiskit_nature/problems/second_quantization/electronic/electronic_structure_problem.py in interpret(self, raw_result)
    174         result = ElectronicStructureResult()
    175         result.combine(eigenstate_result)
--> 176         self._grouped_property_transformed.interpret(result)
    177         result.computed_energies = np.asarray([e.real for e in eigenstate_result.eigenenergies])
    178         return result

~/work/Qiskit/qrel_env/lib/python3.8/site-packages/qiskit_nature/properties/grouped_property.py in interpret(self, result)
    104         """
    105         for prop in self._properties.values():
--> 106             prop.interpret(result)

~/work/Qiskit/qrel_env/lib/python3.8/site-packages/qiskit_nature/properties/second_quantization/electronic/particle_number.py in interpret(self, result)
    199 
    200             if aux_op_eigenvalues[_key] is not None:
--> 201                 n_particles = aux_op_eigenvalues[_key][0].real  # type: ignore
    202                 result.num_particles.append(n_particles)
    203 

TypeError: 'float' object is not subscriptable

Replace VQEProgram with VQEClient in qiskit-nature notebook

VQEProgram has been deprecated and VQEClient should be used instead.

"And finally we can construct a new VQE solver using `VQEProgram`:"
]
},
{
"cell_type": "markdown",
"id": "93b95cf7",
"metadata": {
"slideshow": {
"slide_type": "notes"
}
},
"source": [
"> Note: `VQEProgram` will be renamed to `VQEClient` in Qiskit Nature v0.3.0!"
]
},
{
"cell_type": "code",
"execution_count": 25,
"id": "6f57f58e",
"metadata": {
"slideshow": {
"slide_type": "-"
}
},
"outputs": [],
"source": [
"from qiskit_nature.runtime import VQEProgram\n",
"\n",
"optimizer = {\n",
" \"name\": \"SPSA\",\n",
" \"maxiter\": 50,\n",
"}\n",
"initial_point = np.random.random(ansatz.num_parameters)\n",
" \n",
"runtime_vqe = VQEProgram(\n",
" ansatz=ansatz,\n",
" optimizer=optimizer,\n",
" initial_point=initial_point,\n",
" provider=provider,\n",
" backend=backend,\n",
" shots=1024,\n",
" measurement_error_mitigation=True,\n",
")"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.