Installing the Dynex SDK - dynexcoin/DynexSDK GitHub Wiki

The Dynex SDK provides a n.quantum Ising/QUBO sampler which can be called from any Python code. Developers and application developers already familiar with the Dimod framework, PyQUBO or the Ocean SDK will find it very easy to run computations on the Dynex neuromorphic computing platform: The Dynex Sampler object can simply replace the default sampler object which typically is used to run computations on, for example, the D-Wave system – without the limitations of regular quantum machines. The Dynex SDK is a suite of open-source Python tools for solving hard problems with neuromorphic computing which helps reformulate your application’s problem for solution by the Dynex computing platform. It also handles communication between your application code and the Dynex neuromorphic computing platform automatically. We also offer pre-configured docker files.

Installation of the Dynex SDK

1. Install the Dynex SDK package locally:

The Dynex SDK can be installed with

pip install dynex

2. Install the free Dynex local testnet sampler (optional)

If you also want to use local sampling for free testing purposes (sampling by specifying "mainnet=False"), you also need to install:

3. Download your configuration dynex.ini

Navigate to the Dynex Platform and create your account. In menu item "Installation", open "Step 2" and click the "Download" button to download your configuration file 'dynex.ini'. It contains your private API key and secret. Copy 'dynex.ini' into the directory where your Python program to be computed is located.

4. Verify dynex.ini settings and enable the Dynex SDK

To start sampling with the Dynex SDK, you need to perform a test to verify that your dynex.ini settings are correct. The command dynex.test() function performs a BMQ model generation, uploads it to the provided FTP endpoint, validates if workers can access computation files and verifies the connectivity to the solution FTP endpoint:

import dynex
dynex.test()

All tests need to run successfully, otherwise you have to revise your configuration:

[DYNEX] TEST: dimod BQM construction...
[DYNEX] PASSED
[DYNEX] TEST: Dynex Sampler object...
[DYNEX] PASSED
[DYNEX] TEST: submitting sample file...
[DYNEX] PASSED
[DYNEX] TEST: retrieving samples...
[DYNEX] PASSED
[DYNEX] TEST RESULT: ALL TESTS PASSED

5. Verify API keys, monitor your balance and see current costs for compute

You can verify and monitor the usage of your Dynex SDK by using the following command:

import dynex
dynex.account_status()

This function verifies your API credentials and returns information about your limits and usage:

ACCOUNT: <YOUR ACCOUNT INFORMATION>
API SUCCESSFULLY CONNECTED TO DYNEX
-----------------------------------
ACCOUNT LIMITS:
MAXIMUM NUM_READS: 100,000
MAXIMUM ANNEALING_TIME: 10,000
MAXIMUM JOB DURATION: 60 MINUTES
COMPUTE:
CURRENT AVG BLOCK FEE: 250.0 DNX
USAGE:
AVAILABLE BALANCE: 50.758234276 DNX
USAGE TOTAL: 39.241765724 DNX

Each account is being setup with a maximum amount of num_reads, annealing_time and a maximum duration for single jobs being computed on the Dynex platform. Based on your deposited balance, you also have a contingent of usage. If you exceed one of these limits, an error is thrown from the Dynex sampler.

The cost for compute on Dynex is based on supply & demand, whereas higher paid compute jobs are being prioritized by the workers. The value "CURRENT AVG BLOCK FEE" shows the current average price for compute. It defines the amount to be paid for each block, which is being produced every 2 minutes. Depending on the number of chips (num_reads), duration (annealing_time), size and complexity of your computational problem, only a fraction of the entire network is being used. The price charged for compute is being calculated as a fraction of the base "block fee" and is being displayed during computing in the Python interface as well as in the "Usage" section of the Dynex market place.

You are ready to use the Dynex SDK to compute on the Dynex Platform