<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def non_sampling_sampler(circuit, meas):
 """Calculate the expectations without sampling."""

    meas = tuple(meas)
    n_qubits = circuit.n_qubits
    return expect(circuit.run(returns="statevector"), meas)