Skip to main content

Q1RAM Client API Methods

Q1RAM (Quantum Random Access Memory) is a quantum memory architecture designed to enable efficient storage and retrieval of quantum data at an any arbitrary address(es) with O(1) complexity, as introduced in the US patent "A Novel Efficient Quantum Random Access Memory". This client API provides methods to interact with Q1RAM, allowing manipulation of quantum memory in both single and superposition states.

Notes

  • All API calls require valid authentication credentials, by registering on https://q1ram.com.
  • The methods interact with the Q1RAM backend via HTTP requests and update the local quantum circuit accordingly.
  • For advanced usage, you can provide custom quantum registers for address and data.

Authentication

Before using any method, authenticate with the API:

from q1ram import authenticate
authenticate()

1. read

Purpose:
Reads data from the Q1RAM at a specified address or in superposition.

Signature:

read(address_register=None, data_register=None, address_value=None, data_value=None)

Parameters:

  • address_register: Optional. QuantumRegister or list specifying the address qubits.
  • data_register: Optional. QuantumRegister or list specifying the data qubits.
  • address_value: Optional. List of integers specifying the classical address to read from. If omitted, reads in superposition.
  • data_value: Optional. List of integers specifying the classical data to match (rarely used for read).

Usage Examples:

  • Read from a superposition address states:
    qram.read(address_value=[0, 1])
    

2. write

Purpose:
Writes data to the Q1RAM at a single or superposition address states.

Signature:

write(address_register=None, data_register=None, address_value=None, data_value=None)

Parameters:

  • address_register: Optional. QuantumRegister or list specifying the address qubits.
  • data_register: Optional. QuantumRegister or list specifying the data qubits.
  • address_value: Optional. List of integers specifying the classical address to write to. If omitted, writes in superposition.
  • data_value: Required. List of integers specifying the data to write.

Usage Examples:

  • Write to a specific address:
    qram.write(address_value=[0, 1], data_value=[5])
    

3. read_all

Purpose:
Reads all data from Q1RAM, typically used to retrieve the full memory contents.

Signature:

read_all()

Usage Example:

qram.read_all()

Example Workflow

from q1ram_client.q1ram.circuit import Q1RAM, authenticate
from qiskit import QuantumCircuit

authenticate()
qc = QuantumCircuit()
qram = Q1RAM(qc, number_address_qubits=2, number_data_qubits=2)

# Write data to address [0, 1]
qram.write(address_value=[0, 1], data_value=[1, 0])

# Read data from address [0, 1]
qram.read(address_value=[0, 1])

# Write data in superposition
qram.write(data_value=[1, 1])

# Read all data in superposition
qram.read()

Metadata

Release files for q1ram 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for q1ram 0.3.4
File Size Uploaded Provenance Actions
q1ram-0.3.4.tar.gz 34.0 kB Without provenance Details for q1ram-0.3.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for q1ram 0.3.4
File Interpreter ABI Platform Actions
q1ram-0.3.4-py3-none-any.whl Python 3 none any Details for q1ram-0.3.4-py3-none-any.whl

Total release size: 70.3 kB

Release files / q1ram-0.3.4.tar.gz

Download URL q1ram-0.3.4.tar.gz
Size 34.0 kB
Tags Source
SHA-256 checksum
How to use checksums
3b6c648ae7792bf9106e8c5cf928bc3f8f80ab667a876f702d350a51dc19e70f
BLAKE2b-256 checksum
How to use checksums
57e3a7f9eb8a6d1045a70cb480ef7cf607cc1266e5bcfe47acecad3f995e96b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Release files / q1ram-0.3.4-py3-none-any.whl

Download URL q1ram-0.3.4-py3-none-any.whl
Size 36.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6b951d4866d429be6baf7fdf589200b1e429e206df11ca534629986e242a578
BLAKE2b-256 checksum
How to use checksums
268d9dd6cd2e6b4986650beee16c5b8bc0e04c242bfadf47ded27c7bb53b391b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.7

Security for q1ram 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page