Comments (11)
This is fully implemented in the ProjectQ plugin).
from pennylane.
The only open thing is the configuration file issue, but that is maybe something separate.
from pennylane.
The second options would be very useful.
from pennylane.
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.
I think a plugin that requires credentials but doesn't get them (via a keyword argument, probably) should just raise a ValueError.
from pennylane.
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.
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.
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.
@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.
We can keep this open for the configuration file, or close this and create a separate issue
from pennylane.
Closed, implemented in #40.
from pennylane.
Related Issues (20)
- [BUG] CNOT decomposes to CNOT
- [BUG] Some decompositions/transforms do not preserve derivatives HOT 1
- [BUG] `defer_measurements` does not work with `qml.cond` applied to controlled gates HOT 3
- Define `BasisStateProjector.compute_sparse_matrix` HOT 3
- [BUG] `KerasLayer` has unintended side effects on its QNode HOT 1
- [BUG] Documentation generated does not show the parameters for subclasses of Operation. HOT 1
- Add support for Quantum ESPRESSO HOT 2
- [BUG] `QuantumScript.map_to_standard_wires` sometimes returns original tape HOT 2
- [CHORE] Update `docs/requirements.txt` to reduce package bloat
- [BUG] Differentiation does not work with `dynamic_one_shot` HOT 1
- [BUG] Different ground states when batching with vmap or calling the function directly HOT 5
- Add `PrepSelPrep` block encoding template HOT 4
- Support variable number of trotter steps in the UCCSD ansatz HOT 12
- [BUG] No warnings or errors are being raised when `shots` argument is passed arbitrarily to `@qnode` with no applicable gradient method HOT 5
- [BUG] `qml.simplify` removes information regarding `num_steps` from `Exp`
- [BUG] QAOA layers incorrectly forbid `Sum` observables
- Add function to convert PennyLane objects to OpenFermion objects HOT 2
- [BUG] Adjoint method does not respect global wires return types
- [BUG] TorchLayer does not work correctly with broadcasting and `tuple` returns HOT 1
- Propagate the gradient to part of an array only HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pennylane.