wildqat package

Wildqat is an open source Python framework for QUBO.

class wildqat.opt[source]

Optimizer for SA/SQA.

plot()[source]

Draws energy chart using matplotlib.

run(shots=1, sampler='normal', targetT=0.02, verbose=False)[source]

Run SA with provided QUBO. Set qubo attribute in advance of calling this method.

sqa()[source]

Run SQA with provided QUBO. Set qubo attribute in advance of calling this method.

E = None

List of energies

Gf = None

Final strength of transverse magnetic field. [SQA]

Gs = None

Initial strength of transverse magnetic field. [SQA]

R = None

Descreasing rate of temperature [SA]

RBMvisible = None

RBM Models

Tf = None

Final temperature [SA]. Temperature [SQA]

Ts = None

Initial temperature [SA]

ite = None

Iterations [SA]

qubo = None

QUBO

tro = None

Trotter slices [SQA]

wildqat.diag(diag_ele)[source]

Create QUBO with diag from list

print(wq.diag([1,2,1]))
#=>
[[1 0 0]
[0 2 0]
[0 0 1]]
wildqat.net(narr, nnet)[source]

Automatically create QUBO which has value 1 for all connectivity defined by array of edges and graph size N

print(wq.net([[0,1],[1,2]],4))
#=>
[[0. 1. 0. 0.]
[0. 0. 1. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]

this create 4*4 QUBO and put value 1 on connection between 0th and 1st qubit, 1st and 2nd qubit

wildqat.pauli(qubo)[source]

Convert to pauli operators of universal gate model. Requires blueqat.

wildqat.rands(rands_ele)[source]

Create random QUBO

wildqat.sel(selN, selK, selarr=[])[source]

Automatically create QUBO which select K qubits from N qubits

print(wq.sel(5,2))
#=>
[[-3  2  2  2  2]
[ 0 -3  2  2  2]
[ 0  0 -3  2  2]
[ 0  0  0 -3  2]
[ 0  0  0  0 -3]]

if you set array on the 3rd params, the result likely to choose the nth qubit in the array

print(wq.sel(5,2,[0,2]))
#=>
[[-3.5  2.   2.   2.   2. ]
[ 0.  -3.   2.   2.   2. ]
[ 0.   0.  -3.5  2.   2. ]
[ 0.   0.   0.  -3.   2. ]
[ 0.   0.   0.   0.  -3. ]]
wildqat.zeros(zeros_ele)[source]

Create QUBO with all element value as 0

print(wq.zeros(3))
#=>
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]