
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Welcome to QLEO, a Python library designed for building, simulating, and analyzing quantum circuits powerd by MIMIQ emulator of QPerfect.
Install the library directly from the Quobly GitHub repository:
pip install qleo
To enable visualization feature, ensure you install:
pip install qleo[visualization]
Start by importing the qleo
library. This library provides tools for creating, manipulating, and simulating quantum circuits.
Import the Library
By using from qleo import *
, you gain access to all classes and methods required for quantum circuit operations.
from qleo import *
Create and Manipulate Circuits
In this step, you create a quantum circuit with Circuit()
and add gates to it.
Hadamard Gate (GateH)
: Places each qubit in a superposition state.
Controlled-Z Gate (GateCZ)
: Introduces entanglement between qubits by applying a phase shift if both qubits are in the |1⟩ state.
n = 10
c = Circuit()
c.push(GateH(), range(n))
c.push(GateCZ(), range(n-1), range(1,n))
c.push(GateCZ(), 0, n-1)
Execute & Get Result
Here, you execute the circuit on QuoblySimulator (Simulates the quantum circuit using a state vector approach
) and retrieve the result.
processor = Qleo()
result = processor.execute(c, nsamples=1000)
print(result)
The result contains detailed information about the circuit execution:
QCSResults:
├── simulator: Quantanium StateVector 1.0
├── timings:
│ ├── apply time: 0.000318101s
│ └── sample time: 0.000277592s
├── fidelity estimate: 1
├── average multi-qubit gate error estimate: 0
├── most sampled:
│ ├── bs"0100001000" => 5
│ ├── bs"0000000000" => 5
│ ├── bs"1001010001" => 5
│ ├── bs"0111011110" => 5
│ └── bs"0010001010" => 4
├── 1 executions
├── 0 amplitudes
└── 1000 samples
The output provides a summary of your simulation results, including key information about the backend used, execution details, and measurement outcomes. You'll find details such as the simulator type, timings for circuit execution and measurement, fidelity estimates, and the most frequently observed quantum states. Additionally, it includes the total number of samples and any specific execution metrics for analyzing the performance and accuracy of your quantum circuit.
Get Histogram of the samples
The result.histogram()
method generates a counts distribution of the sampled measurement outcomes.
result.histogram()
Visualizing the results
To visualize the results of your quantum circuits, you can use the plothistogram
function provided by the qleo.visualization
module.
Example
from qleo.visualization import plothistogram
plothistogram(result)
The Quobly Framework is based on MIMIQ by QPerfect. Comprehensive documentation, tutorials, and examples on how to build circuits with the Quobly Framework and MIMIQ are available at docs.qperfect.io. Please remember to substitute any occurrences of mimiqcircuits
in the documentation with quoblyframwork
. For example, in place of from mimiqcircuits import *
, use from qleo import *
.
For issues, suggestions, or inquiries, reach out via:
FAQs
Quobly Logical Emulator Online
We found that qleo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.