"default.mixed" noisy simulator gave identical results to "lightning.qubit"?

Hi all.
My team and I are working on training and evaluating a Quantum - Classical hybrid neural networks and after training with lightning.qubit simulator, we wanted to see if using default.mixed noisy simulator will have significant effect on the results
However, we found that the results are identical , which we do not understand as we thought implementing noise would alter the results a bit.

What’s causing this? I attached our code for generating the quantum circuit.

def create_qnn(n_qubits, n_layers, device_type="lightning.qubit"):
    dev = qml.device(device_type, wires=n_qubits)
    
    @qml.qnode(dev)
    def circuit(inputs, weights):
        encoded_inputs = Arctan_Encoding()(inputs)
        # Feature map
        for i in range(n_qubits):
            qml.RY(encoded_inputs[i], wires=i)
        
        # Ansatz
        for layer in range(n_layers):
            for i in range(n_qubits):
                qml.RY(weights[layer * n_qubits + i], wires=i)
            for i in range(n_qubits - 1):
                qml.CNOT(wires=[i, i + 1])
        
        return [qml.expval(qml.PauliZ(i)) for i in range(n_qubits)]
    
    weight_shapes = {"weights": n_layers * n_qubits}
    
    return circuit, weight_shapes

Thank you

Hi @hoonjkim , welcome to the Forum!

default.mixed is a simulator that allows you to add noise channels and noise models, but it doesn’t come with any predefined noise model.

In PennyLane we have noise models that you can construct and customize as seen in our demo on how to use noise models in PennyLane. They don’t follow any specific device so you can build them according to your needs. We also have a new functionality where you can convert noise models from Qiskit. You can see an example in the release blog for PennyLane v0.38.
I hope one of these options work for you. Let us know if you run into any issues!

1 Like

Thanks @CatalinaAlbornoz , this helped us a lot!

I’m glad to hear @hoonjkim !

1 Like