Blueqat

Latest version: v2.0.4

Safety actively analyzes 630169 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 6

0.6.0

Photonics Continuous Variable Programming Integrated

python
from blueqat import photonqat as pq
import numpy as np
import matplotlib.pyplot as plt

mode number = 2, cutoff dimension = 15
F = pq.Fock(2, cutoff = 15)

alpha = (1 + 1j)

0.5

F.D(0, alpha) Displacement to mode 0
F.S(1, r) Squeezeng to mode 1

F.run()

Plot Wigner fucntion for mode 0 using matplotlib
(x, p, W) = F.Wigner(0, plot = 'y', xrange = 5.0, prange = 5.0)

0.5.0

Circuit Drawing

- Circuit drawing function with networkx

Circuit.h[0].cx[0,1].run(backend="draw")

0.4.9

Debug
- Correct `TGate.matrix()`, `TDagGate.matrix()`, `IGate.matrix()`

Experimental Feature
- New sampling feature is available in the numpy backend. This feature may effective for mid-circuit measurement.

Specify `m(key="keyname")` in the measurement and `run(shots=..., returns="samples").
Circuit().x[1].m(key="key1")[0, 1].x[0].m(key="key2")[0, 1].run(shots=5, returns="samples")

It returns
[{'key1': [0, 1], 'key2': [1, 1]},
{'key1': [0, 1], 'key2': [1, 1]},
{'key1': [0, 1], 'key2': [1, 1]},
{'key1': [0, 1], 'key2': [1, 1]},
{'key1': [0, 1], 'key2': [1, 1]}]
You get 5 samples for each measured keys.

When run(returns="sample"), measured result without the key is omitted.

If the key is duplicated, another option is needed, "replace" or "append".

"replace" pattern
Circuit().x[0].m(key="a")[:].x[0].m(key="a", duplicated="replace")[0].run(shots=2, returns="samples")

It returns
[{'a': [0]}, {'a': [0]}]
So, the first measured result of key "a" is omitted and replaced to second one.

"append" pattern
Circuit().x[0].m(key="a")[:].x[0].m(key="a", duplicated="append")[0].run(shots=2, returns="samples")

It returns
[{'a': [1, 0]}, {'a': [1, 0]}]
So, the second measured result is appended to first one.


Changes
- Circuit JSON scheme is updated due to experimental features.

Internal Changes
Implementation of gates are changed

0.4.8

New feature
- Builtin-macros
- `mcx_with_ancilla(ctrl: list[int], target: int, ancilla: int) -> Circuit`
- `mcz_with_ancilla(ctrl: list[int], target: int, ancilla: int) -> Circuit`

Major changes
- Remove wq module
- We recommend using dwave-ocean-sdk library for annealing task.
- `wq.pauli` function (It translates QUBO to pauli matrix for QAOA) is moved to `pauli.to_qubo` function.

Minor changes
- Internal implementation of Circuit
- It cheats type-checker likes pyright for suppressing errors.

0.4.7

New feature
- Built-in macros.
- To activate, run `import blueqat.macros`.
- `draw`, `margolus`, `c3z`, `c4z`, `c3x`, `c4x`, `mcx_gray`, `mcz_gray`, `mcrx_gray`, `mcry_gray`, `mcrz_gray`, `mcr_gray`, `mcu_gray` are available.

API Change
- `blueqat.utils.circuit_to_unitary` is moved to `blueqat.circuit_utils.circuit_to_unitary`.

Page 2 of 6

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.