According to Bernard Zygelman "A First Introduction to Quantum Computing and Information", I can compute the $QS|f\rangle$ with $|f\rangle = \frac{1}{\sqrt{2}} (|00\rangle -|11\rangle)$, with $Q=Z$, $S = \frac{1}{\sqrt{2}}(X+Z) = H$, but
Q: How can you compute $\langle f|QS|f\rangle$?
Here my code up to now
import qiskit as q
circuit = q.QuantumCircuit(2,2)
circuit.x(0)
circuit.h(0)
circuit.cx(0,1)
backend = q.Aer.get_backend('statevector_simulator')
result = q.execute(circuit, backend=backend).result()
print(circuit)
print(result.get_statevector()) # 1/sqrt(2) (|00> -|11>)
# CSHS <QS> = 1/sqrt(2)
circuit = q.QuantumCircuit(2,2)
circuit.x(0)
circuit.h(0)
circuit.cx(0,1)
circuit.z(0) # Q = Z
circuit.h(1) # S = 1/sqrt(2)*(X+Z) = H
print(circuit)
#circuit.measure([0,1],[0,1])
backend = q.Aer.get_backend('statevector_simulator')
result = q.execute(circuit, backend=backend).result()
print(result.get_statevector())
I got the correct output state: Statevector([ 0.5+0.j, 0.5+0.j, 0.5+0.j, -0.5+0.j], dims=(2, 2))