def prepare_product_state(state: BitString) -> QCircuit:
    'Small convenience function\n\n    Parameters\n    ----------\n    state :\n        product state encoded into a bitstring\n    state: BitString :\n\n\n    Returns\n    -------\n    type\n        unitary circuit which prepares the product state\n\n    '
    result = QCircuit()
    for (i, v) in enumerate(state.array):
        if (v == 1):
            result += gates.X(target=i)
    return result
Small convenience function

Parameters
----------
state :
    product state encoded into a bitstring
state: BitString :


Returns
-------
type
    unitary circuit which prepares the product state
def prepare_product_state(state: BitString) -> QCircuit:
    'Small convenience function\n\n    Parameters\n    ----------\n    state :\n        product state encoded into a bitstring\n    state: BitString :\n\n\n    Returns\n    -------\n    type\n        unitary circuit which prepares the product state\n\n    '
    result = QCircuit()
    for (i, v) in enumerate(state.array):
        if (v == 1):
            result += gates.X(target=i)
    return result