# Delivering Correct Wires To QNode

**URL:** <https://discuss.pennylane.ai/t/delivering-correct-wires-to-qnode/326>\
**Category:** PennyLane Help\
**Created:** [January 27, 2020, 9:17am UTC](https://discuss.pennylane.ai/t/delivering-correct-wires-to-qnode/326 "2020-01-27T09:17:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![QMLHappy](https://avatars.discourse-cdn.com/v4/letter/q/c37758/32.png) [@QMLHappy](https://discuss.pennylane.ai/u/QMLHappy)\
**Post date:** [January 27, 2020, 9:17am UTC](https://discuss.pennylane.ai/t/delivering-correct-wires-to-qnode/326/1 "2020-01-27T09:17:43Z")

</div>

Hi,

I’m trying to pass a list of wires that I want my QNode to operate on to my default QNode. I’ve been trying to do a couple things:

1. print out the values that I’m passing in to make sure that I’m passing in the correct values
2. get the values to be recognized in the QNode to define my operations

my code flows something like the following:

```
dev = qml.device('default.qubit', wires=4)
@qml.qnode(dev, interface='torch')
def QCircuit(wire):    
	#I can't assign the wire values; it just won't let me do it, even when 
        my defined values are integers
	qml.RX(1., wires=wire[0]) 
	qml.RY(2., wires=wire[1])
        qml.RZ(3., wires=wire[2])
	qml.RX(4., wires=wire[3])
	#This is a test to see if I can print out the value- I fail at doing this
        test=wire[0]
        print(test)
        #print(Variable(test).data.numpy())
    return qml.expval(qml.PauliZ(0))
class QuantumCircuitTest(torch.nn.Module):
    def __init__ (self, input):
        super(QuantumCircuitTest, self). __init__ ()
	self.wire = [0,1,2,3]
    def forward(self, input):
	return QCircuit(self.wire)

```

Printing the above value doesn’t give me anything hopeful at most I get  
‘Variable 10: name = None,’  
Furthermore I get thrown an error when I try to do ‘wires=wire[0]’

Any ideas or suggestions? At this point I’m stuck.

---

<div class="post-metadata">

**Author:** ![josh](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/josh/32/100_2.png) [@josh](https://discuss.pennylane.ai/u/josh)\
**Post date:** [January 27, 2020, 3:45pm UTC](https://discuss.pennylane.ai/t/delivering-correct-wires-to-qnode/326/2 "2020-01-27T15:45:53Z")

</div>

Hi @QMLHappy!

Because wires are non-differentiable (they only accept integer values), they must be passed as **keyword arguments**.

Anything passed as a positional argument, PennyLane will assume is differentiable. By passing as a keyword argument, this instructs PennyLane not to attempt to differentiate them.

For example,

```python
dev = qml.device('default.qubit', wires=4)

@qml.qnode(dev, interface='torch')
def QCircuit(wire=None): # keyword argument
    qml.RX(1., wires=wire[0]) 
    qml.RY(2., wires=wire[1])
    qml.RZ(3., wires=wire[2])
    qml.RX(4., wires=wire[3])
    print(wire)
    return qml.expval(qml.PauliZ(0))

class QuantumCircuitTest(torch.nn.Module):
    def __init__ (self, input):
        super(QuantumCircuitTest, self). __init__ ()
        self.wire = [0, 1, 2, 3]

    def forward(self, input):
        return QCircuit(wire=self.wire) #keyword argument

```

Running this circuit:

```nohighlight
>>> qc = QuantumCircuitTest([0])                                                                                                                                                                              
>>> qc([0])                                                                                                                                                                                                   
[0, 1, 2, 3]
tensor(0.5403, dtype=torch.float64)

```

Note that with a keyword argument, the print statement now also works 🙂
