Defined in qunit.hpp.

Qrack::QUnit maintains explicit separation of representation between separable subsystems, when possible and efficient, greatly reducing memory and execution time overhead.

Qrack::QInterface::TrySeparate() is primarily intended for use with Qrack::QUnit.

inline virtual bool Qrack::QInterface::TrySeparate(bitLenInt qubit)

Single-qubit TrySeparate()

inline virtual bool Qrack::QInterface::TrySeparate(bitLenInt qubit1, bitLenInt qubit2)

Two-qubit TrySeparate()

inline virtual bool Qrack::QInterface::TrySeparate(const std::vector<bitLenInt> &qubits, real1_f error_tol)

Qrack::QUnit types maintain explicit separation of representations of qubits, which reduces memory usage and increases gate speed.

This method is used to manually attempt internal separation of a QUnit subsytem. We attempt a Decompose() operation, on a state which might not be separable. If the state is not separable, we abort and return false. Otherwise, we complete the operation, add the separated subsystem back in place into the QUnit “shards,” and return true.

This should never change the logical/physical state of the QInterface, only possibly its internal representation, for simulation optimization purposes. This is not a truly quantum computational operation, but it also does not lead to nonphysical effects.