Introduction
Sign Up? Sign Up!
Section titled “Sign Up? Sign Up!”To start using our service, simply sign up free! With our free service, you get to encode up to 12 qubit quantum state vector! For larger quantum state encoding tasks, we also offer standard and enterprise-class services. Please contact us if you are interested.
You need the API key
Section titled “You need the API key”To do anything with our service, you need to fetch your API key.
Getting your API key is simple. Log on to the Portal and click on Settings > API Keys,
and then add an API key to your account. Make sure to copy it somewhere safe!
This key is required for access to Q-Alchemy.
Best way to use the API: our SDK
Section titled “Best way to use the API: our SDK”The best way to use the API is really through the Python SDK!
In the provided example Jupyter notebooks, you will see that you need to copy the API key to the right place:
from q_alchemy.initialize import q_alchemy_as_qasmqasm, summary = q_alchemy_as_qasm(state, max_fidelity_loss=0.2, api_key="<your api key>", return_summary=True)from q_alchemy.qiskit_integration import QAlchemyInitialize, OptParamsinstr = QAlchemyInitialize( params=state.tolist(), opt_params=OptParams( max_fidelity_loss=0.1, basis_gates=["id", "rx", "ry", "rz", "cx"], api_key="<your api key>" ))import pennylane as qmlfrom q_alchemy.pennylane_integration import QAlchemyStatePreparation, OptParams@qml.qnode(dev)def circuit(state=None): QAlchemyStatePreparation( state, wires=range(10), opt_params=OptParams( max_fidelity_loss=0.1, basis_gates=["id", "rx", "ry", "rz", "cx"], api_key="<your api key>" ) ) return qml.state()It really is that simple! For more information, check out our reference documentation, or go to the GitHub repository for more examples.
Want to get to know the API in Detail? A Live-Demo!
Section titled “Want to get to know the API in Detail? A Live-Demo!”We use our Python SDK to do a full Q-Alchemy Job:
- Connect to the API
- Create a random 12 qubit quantum state
- Create a new Q-Alchemy Job
- Configure the Job: a fidelity loss and tags to find the job again
- Upload the quantum state vector
- Check the Q-Alchemy Job
- Schedule the Q-Alchemy Job
- Fetch the Results
If you would like a live demonstration, contact us today!
Connecting our service to your work
Section titled “Connecting our service to your work”Finally, you want to use Q-Alchemy to help you to do better research! How do you integrate the resulting data into your quantum circuit?
The Q-Alchemy SDK provides a simple interface to the API, returning a circuit in your preferred language. You can then simply drop it into your quantum circuit and go!
Write your request with your programming language
Section titled “Write your request with your programming language”Q-Alchemy internally uses a PineXQ-based REST API.
Advanced users may wish to use this API directly.
Using the header X-Api-Key: API-KEY, you should be able to request the JSON payload.
The Hypermedia+Siren API has a fixed structure for semantic ease so that you can expect the same elements throughout.
The Python SDK provides an example of how to consume such an API.