Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Bartiq is a library that allows one to analyze quantum algorithms and calculate symbolic expressions for quantum resource estimates (QRE).
To install bartiq
run: pip install bartiq
.
In order to install it from source clone the repo by running git clone https://github.com/PsiQ/bartiq.git
and then run pip install .
from the main directory.
# Clone bartiq repo (you can use SSH link as well)
git clone https://github.com/PsiQ/bartiq.git
cd bartiq
pip install .
In bartiq we can take a quantum algorithm expressed as a collection of subroutines, each with its costs expressed as symbolic expressions, and compile it to get cost expression for the whole algorithm.
As an example we can use Alias Sampling – an algorithm proposed by Babbush et al.. Here's how it's depicted in the paper:
In order to quickly get started with bartiq
, you can load Alias Sampling as an example routine and use it as follows (click here to download alias_sampling_basic.json
):
import json
from bartiq import compile_routine, evaluate
from qref import SchemaV1
with open("docs/data/alias_sampling_basic.json", "r") as f:
routine_dict = json.load(f)
uncompiled_routine = SchemaV1(**routine_dict)
compiled_routine = compile_routine(uncompiled_routine).routine
assignments = {"L": 100, "mu": 10}
evaluated_routine = evaluate(compiled_routine, assignments).routine
Now in order to inspect the results you can do:
print(compiled_routine.resources["T_gates"].value)
print(evaluated_routine.resources["T_gates"].value)
which returns both symbolic the expression for the T-count as well as result for specific values of L
and mu
:
4*L + 8*L/multiplicity(2, L) + 4*mu + swap.O(log2(L)) - 8
swap.O(log2(100)) + 832
To go step by step through the process and see how you can use bartiq for your algorithms, please take a look at our tutorials, starting with basic example.
Documentation for bartiq
can be found here.
FAQs
Symbolic Quantum Resource Estimation compilation
We found that bartiq demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.