weighted_tqdm allows for weighted iterations in tqdm progress bars.
Project description
weighted_tqdm
Install via
pip install weighted_tqdm
Import via
from weighted_tqdm import *
Description
weighted_tqdm works equivalently to tqdm, accepting all the same arguments, but also accepts a weights
argument. This argument specifies the weights of each item in the iterable and can be given as a function of the iterable or be any iterable (list, array, tuple...). The progress bar will then take into account the weights of each item in it's prediciton of the time, and it's progress bar will be weighted accordingly. To the left of the progress bar an iteration counter is shown.
qudit_tqdm is a special version of tqdm, that predicts the remaining time for calculations in quantum mechanics, with the added arguments dit
specifying whether its a calculation of qubits(default, dit = 0.3, = 3
for qutrits), and the argument exp
specifying the scaling of computational time with the dimension of a hilbert space.
Examples:
from weighted_tqdm import *
how_many_qubits = [1,2,3,4,5]
qubits weights = lambda x: (2**x)**3
for i in weighted_tqdm(how_many_qubits, weights=weights):
# do something
or equivalently
from weighted_tqdm import *
how_many_qubits = [1,2,3,4,5]
for i in qudit_tqdm(how_many_qubits, dim=2, exp=3):
# do something
Authors:
By Michael Schilling
Project details
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
File details
Details for the file weighted_tqdm-0.3.tar.gz
.
File metadata
- Download URL: weighted_tqdm-0.3.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 361bd96447848f16116c47ab530826d87c4712085eba328cf83aefaae9a10047 |
|
MD5 | 70236ac1d795c456f3342d0507ee5948 |
|
BLAKE2b-256 | 4625416e78d969687e5763162a1cc0c8387925254b305d3df3cfea3b01f55882 |
File details
Details for the file weighted_tqdm-0.3-py3-none-any.whl
.
File metadata
- Download URL: weighted_tqdm-0.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ed0765b9810c47cb911a4b00d241d36554f9398876743bf30eb5e540cdf7f72 |
|
MD5 | 890f3bc5a3a70fce35aa8357deee781b |
|
BLAKE2b-256 | 9f7a1e1b21739673c87321ff5c29289b0747924fe7dc3f99d62eaf66124414c3 |