fixed merged errors, added core of mqubed (reverted from commit 0c94ff9262f57e95bcbf8427c1b1ece72f8fb6b0)