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.3

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.3
File Size Uploaded Provenance
q1ram-0.3.3.tar.gz 34.2 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 70.9 kB

Release files / q1ram-0.3.3.tar.gz

Download URL q1ram-0.3.3.tar.gz
Size 34.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e773a2dd11f91b17b5916293e583068be524df70d881de4032c7bfd3280f8071
BLAKE2b-256 checksum
How to use checksums
003f478ff862372f3d22d7205e1719bfdcc67a6a7b7efcd46efb288a1ac7ed00
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.3-py3-none-any.whl

Download URL q1ram-0.3.3-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
52fc0c5288a38661c626b1179aa1511d0a881d8f6fac12178a64435b2274a163
BLAKE2b-256 checksum
How to use checksums
af3d3f56f013d0e8ff98364f47c1da2a747146e0ee452b1ccc2119e11efdbbf0
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.3

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.

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