Function qb::create_initial_state_simplify_pass

Function Documentation

inline std::shared_ptr<CircuitPass> qb::create_initial_state_simplify_pass()

Whenever a gate transforms a known basis state to another known basis state, remove it, inserting X gates where necessary to achieve the same state.

Note: this is contextual pass (i.e., the circuit may not represent the same unitary but have the same effect given the initial state)