1
$\begingroup$

I'm working on wolfram cloud notebook to simulate Discrete-Time Quantum Random Walk on hypercube. But, in the QuatumCircuitOperator, I found an unexpected behaviour. Here is my code:

PacletInstall[ResourceObject["https://wolfr.am/11ftY6W2s"]]
Needs["Wolfram`QuantumFramework`"]

n = 4;
d = 4;
m = Ceiling[Evaluate[Log[2,Evaluate[n]]]];
m = Evaluate[m];

posn = QuantumState["Register"[n]];
coin = QuantumState["Register"[m]];

list =Table[x,{x,m}]
qc = QuantumOperator[{"C","X"->{m},Delete[list,m]}]
qc["CircuitDiagram"]

coin_op=QuantumCircuitOperator[{QuantumOperator["H"->list],QuantumOperator["X"->list],QuantumOperator["H"->{m}],QuantumOperator["H"->{m}],QuantumOperator["X"->list],QuantumOperator["H"->list]}];
coin_op["Diagram"]

Here, last line just prints "coin_op[Diagram]" string in stead of the circuit diagram, however when I change the code like:

coin_op=QuantumCircuitOperator[{QuantumOperator["H"->list],QuantumOperator["X"->list],QuantumOperator["H"->{m}],QuantumOperator["H"->{m}],QuantumOperator["X"->list],QuantumOperator["H"->list]}]["Diagram"]

It prints the circuit diagram, so how can I resolve this issue ? Thanks for the help.

$\endgroup$
1
  • 3
    $\begingroup$ The cause of your problem is using underscores in the variable name - use coinOp instead of coin_op. Also you don't have to use Evaluate in your code, it is doing nothing at all. $\endgroup$ Commented Feb 4 at 18:10

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.