pdft.circuit.contract_circuit

pdft.circuit.contract_circuit#

pdft.circuit.contract_circuit(tensors, code, m, n, pic)[source]#

Run code on pic laid out one axis per qubit, and give back a (2**m, 2**n) array.

Nothing is cast and nothing is checked: the precision of the result is what the tensors and the image promote to, and any pic with 2**(m + n) elements is accepted. loss_function and the Rich, RealRich and Blocked transforms have always applied a circuit this way, which is why single-precision tensors stay single precision through them.

Parameters:
Return type:

Array