A client for submitting DMRG calculation tasks and polling results
Project description
DMRG Task Client
A Python client for submitting DMRG calculation tasks to a server and polling results.
Installation
pip install entropec-quantumoperator-test
Usage Example
from entropec_quantumoperator_test import DMRGClient
# Initialize client with server URL
client = DMRGClient(api_base="http://192.168.124.22:12805")
# Define task parameters
task_id = "9528"
params = {
"CaseParams": {
"Geometry": "OBC",
"Lx": 3,
"Ly": 4,
"t": 1.0,
"t2": -0.2,
"J": 3.0,
"J2": 1.0,
"phi": 0.1,
"mu": 0,
"NumHole": 2,
"Sweeps": 5,
"Dmin": 10,
"Dmax": 10,
"CutOff": 1e-9,
"LanczErr": 1e-9,
"MaxLanczIter": 70,
"Threads": 2,
"noise": [0.1, 0.01],
"Perturbation": 0.0,
"BondSingletPairPerturbation": 0.0,
"wavelength": 4
}
}
# Submit task
try:
response = client.submit_job(task_id, params)
print("Task submitted successfully:", response)
# Fetch result (with max 20 retries)
result = client.fetch_result(task_id, max_retries=20)
print("Calculation result:", result)
except Exception as e:
print("Error:", str(e))
API Reference
DMRGClient
__init__(api_base, timeout=10, retry_interval=5)
Initialize a new DMRG client.
api_base: Base URL of the DMRG servertimeout: Request timeout in seconds (default: 10)retry_interval: Interval between result polling attempts (default: 5)
submit_job(task_id, params)
Submit a DMRG calculation task.
task_id: Unique identifier for the taskparams: Dictionary containing calculation parameters- Returns: Server response JSON
fetch_result(task_id, max_retries=None)
Poll for calculation results.
task_id: Task identifier to fetch results formax_retries: Maximum number of retries (None for infinite)- Returns: Calculation result text
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file entropec_quantumoperator_test-0.1.0.tar.gz.
File metadata
- Download URL: entropec_quantumoperator_test-0.1.0.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ccdade8111a3e60765b03b24557f64946764476895fb5e2f17fd06ddb968ca4
|
|
| MD5 |
667300b6f5c0fb37cea0048438997ab0
|
|
| BLAKE2b-256 |
4e614fd9d7082aa27bdbd6a53921eb4e36fa04842ece1caae637a91606dbb26b
|
File details
Details for the file entropec_quantumoperator_test-0.1.0-py3-none-any.whl.
File metadata
- Download URL: entropec_quantumoperator_test-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b0f1fd6ef47257d574b6bd9f6f89667c17c8a5565ef2151e07d0168f810c64a
|
|
| MD5 |
69f099ddaae0ace1c7c43a97601ca73c
|
|
| BLAKE2b-256 |
f0ca53ccef342da80ea31874a5249e0114e1255f366f0a31e826b269c65b6cd2
|