by: Kevin Broløs & Tom Jelen
(Feyn version 1.4 or newer)
You can provide your credentials to a
QLattice in two different ways:
- In the
- From a configuration file.
The simplest way is the first option. Here's an example:
import feyn ql = feyn.connect_qlattice(qlattice="a1b2c3d4", api_token="c1a2c3a406d6e6729012e0de4d8c7a2c")
If you don't have your credentials, here's how to find them in the portal
Setting up and using a config file
We recommend setting up a config file, so you can share code with others without revealing your token.
On Linux or OS X, the config file should be called
.feynrc and saved in your home folder or
On Windows, the config file should instead be called
A config file is structured like the example below:
[QuesadillaLattice] qlattice = a1b2c3d4 api_token = c1a2c3a406d6e6729012e0de4d8c7a2c [QuibbleLattice] qlattice = ... api_token = ...
Connecting with a config
You connect to the
QLattice with the
If you have a config defined, the first
QLattice in the list is used by default. You can use the
config option to use a specific one.
import feyn # Using the default (QuesadillaLattice) section. ql = feyn.connect_qlattice() # Using a specific section ql = feyn.connect_qlattice(config="QuibbleLattice")