Giter Site home page Giter Site logo

Comments (11)

cgogolin avatar cgogolin commented on August 20, 2024 1

This is fully implemented in the ProjectQ plugin).

from pennylane.

cgogolin avatar cgogolin commented on August 20, 2024 1

The only open thing is the configuration file issue, but that is maybe something separate.

from pennylane.

mariaschuld avatar mariaschuld commented on August 20, 2024

The second options would be very useful.

from pennylane.

smite avatar smite commented on August 20, 2024

Currently this type of information is stored in the PluginAPI._capabilities dictionary, which is specific to a plugin. Perhaps we should also add backend-specific dictionaries?

from pennylane.

smite avatar smite commented on August 20, 2024

I think a plugin that requires credentials but doesn't get them (via a keyword argument, probably) should just raise a ValueError.

from pennylane.

josh146 avatar josh146 commented on August 20, 2024

I agree with @smite; I think it makes sense to have this fully implemented on the plugin/device side.

This way, the credentials would be completely encapsulated within the plugin/Device class, and passed along in a similar fashion as to other options (such as number of shots, cutoffs, etc.). Something like this:

dev1 = qm.device('ibm.qx4', shots=100, api_key='2321873csad98123bhjsd9')

or, equivalently,

dev1 = qm.device('ibm.qx4')
dev1.shot = 100
dev1.API_KEY = '2321873csad98123bhjsd9'

That way, a plugin can decide how to deal with missing credentials (i.e. raise a ValueError as suggested by Ville). The test suite for the plugin/device + credentials would then be contained in the plugin repo, instead of OpenQML.

In addition, when I implement the local config file for OpenQML, the plugins should also have the ability to read/write to their own sections. For instance, using something like TOML:

[openqml]
#general openqml settings here

[ibm.qx4]
default_shots = 100
api_key = "2321873csad98123bhjsd9"

from pennylane.

cgogolin avatar cgogolin commented on August 20, 2024

The config file is the only real solution, imho.

In the first two cases users can no longer submit their source code to a public repository because it contains their credentials. Even we are "users" in this scenario, because it also prevents me from uploading an example that uses the IBM backend to the OpenQML repository without sharing my credentials with you :-). This is bad.

from pennylane.

josh146 avatar josh146 commented on August 20, 2024

I agree. I think both should be available for flexibility (for instance, this allows the distribution of jupyter notebooks with api_key=# enter API key here in an input cell for the user to fill in after downloading), but the configuration file should be the recommended approach.

from pennylane.

co9olguy avatar co9olguy commented on August 20, 2024

@cgogolin This is the only plugin that currently requires any credentials. Are we ok to close this issue, or any credentials-related code that needs to be backported into openqml proper?

from pennylane.

josh146 avatar josh146 commented on August 20, 2024

We can keep this open for the configuration file, or close this and create a separate issue

from pennylane.

josh146 avatar josh146 commented on August 20, 2024

Closed, implemented in #40.

from pennylane.

Related Issues (20)

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.