code: def test_op_to_state():
      assert operators_to_state(XOp) == XKet()
      assert operators_to_state(PxOp) == PxKet()
      assert operators_to_state(Operator) == Ket()
  
      assert state_to_operators(operators_to_state(XOp("Q"))) == XOp(
          "Q"
      )
      assert state_to_operators(operators_to_state(XOp())) == XOp()
  
      raises(NotImplementedError, lambda: operators_to_state(XKet))
  
file_path: sympy/sympy/physics/quantum/tests/test_operatorset.py
imports: from sympy.core.singleton import S
  from sympy.physics.quantum.operatorset import operators_to_state, state_to_operators
  from sympy.physics.quantum.cartesian import XOp, XKet, PxOp, PxKet, XBra, PxBra
  from sympy.physics.quantum.state import Ket, Bra
  from sympy.physics.quantum.operator import Operator
  from sympy.physics.quantum.spin import JxKet, JyKet, JzKet, JxBra, JyBra, JzBra, JxOp, JyOp, JzOp, J2Op
  from sympy.testing.pytest import raises
label_desc: Use image node_id 2 for calling a global function with example usage: test_op_to_state() without return types