<s> from sympy . physics . quantum . circuitplot import labeller , render_label , Mz , CreateOneQubitGate , CreateCGate <EOL> from sympy . physics . quantum . gate import CNOT , H , SWAP , CGate , S , T <EOL> from sympy . external import import_module <EOL> from sympy . utilities . pytest import skip <EOL> mpl = import_module ( '<STR_LIT>' ) <EOL> def test_render_label ( ) : <EOL> assert render_label ( '<STR_LIT>' ) == r'<STR_LIT>' <EOL> assert render_label ( '<STR_LIT>' , { '<STR_LIT>' : '<STR_LIT:0>' } ) == r'<STR_LIT>' <EOL> def test_Mz ( ) : <EOL> assert str ( Mz ( <NUM_LIT:0> ) ) == '<STR_LIT>' <EOL> def test_create1 ( ) : <EOL> Qgate = CreateOneQubitGate ( '<STR_LIT>' ) <EOL> assert str ( Qgate ( <NUM_LIT:0> ) ) == '<STR_LIT>' <EOL> def test_createc ( ) : <EOL> Qgate = CreateCGate ( '<STR_LIT>' ) <EOL> assert str ( Qgate ( [ <NUM_LIT:1> ] , <NUM_LIT:0> ) ) == '<STR_LIT>' <EOL> def test_labeller ( ) : <EOL> """<STR_LIT>""" <EOL> assert labeller ( <NUM_LIT:2> ) == [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> assert labeller ( <NUM_LIT:3> , '<STR_LIT>' ) == [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def test_cnot ( ) : <EOL> """<STR_LIT>""" <EOL> if not mpl : <EOL> skip ( "<STR_LIT>" ) <EOL> else : <EOL> from sympy . physics . quantum . circuitplot import CircuitPlot <EOL> c = CircuitPlot ( CNOT ( <NUM_LIT:1> , <NUM_LIT:0> ) , <NUM_LIT:2> , labels = labeller ( <NUM_LIT:2> ) ) <EOL> assert c . ngates == <NUM_LIT:2> <EOL> assert c . nqubits == <NUM_LIT:2> <EOL> assert c . labels == [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> c = CircuitPlot ( CNOT ( <NUM_LIT:1> , <NUM_LIT:0> ) , <NUM_LIT:2> ) <EOL> assert c . ngates == <NUM_LIT:2> <EOL> assert c . nqubits == <NUM_LIT:2> <EOL> assert c . labels == [ ] <EOL> def test_ex1 ( ) : <EOL> if not mpl : <EOL> skip ( "<STR_LIT>" ) <EOL> else : <EOL> from sympy . physics . quantum . circuitplot import CircuitPlot <EOL> c = CircuitPlot ( CNOT ( <NUM_LIT:1> , <NUM_LIT:0> ) * H ( <NUM_LIT:1> ) , <NUM_LIT:2> , labels = labeller ( <NUM_LIT:2> ) ) <EOL> assert c . ngates == <NUM_LIT:2> <EOL> assert c . nqubits == <NUM_LIT:2> <EOL> assert c . labels == [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def test_ex4 ( ) : <EOL> if not mpl : <EOL> skip ( "<STR_LIT>" ) <EOL> else : <EOL> from sympy . physics . quantum . circuitplot import CircuitPlot <EOL> c = CircuitPlot ( SWAP ( <NUM_LIT:0> , <NUM_LIT:2> ) * H ( <NUM_LIT:0> ) * CGate ( ( <NUM_LIT:0> , ) , S ( <NUM_LIT:1> ) ) * H ( <NUM_LIT:1> ) * CGate ( ( <NUM_LIT:0> , ) , T ( <NUM_LIT:2> ) ) * CGate ( ( <NUM_LIT:1> , ) , S ( <NUM_LIT:2> ) ) * H ( <NUM_LIT:2> ) , <NUM_LIT:3> , labels = labeller ( <NUM_LIT:3> , '<STR_LIT>' ) ) <EOL> assert c . ngates == <NUM_LIT:7> <EOL> assert c . nqubits == <NUM_LIT:3> <EOL> assert c . labels == [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] </s>
