# Compiler for X8\_01 machine

**URL:** <https://discuss.pennylane.ai/t/compiler-for-x8-01-machine/2711>\
**Category:** Strawberry Fields\
**Created:** [March 10, 2023, 8:42pm UTC](https://discuss.pennylane.ai/t/compiler-for-x8-01-machine/2711 "2023-03-10T20:42:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aditya\_Ranjan](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/aditya_ranjan/32/1545_2.png) [@Aditya\_Ranjan](https://discuss.pennylane.ai/u/Aditya_Ranjan)\
**Post date:** [March 10, 2023, 8:42pm UTC](https://discuss.pennylane.ai/t/compiler-for-x8-01-machine/2711/1 "2023-03-10T20:42:53Z")

</div>

I used the default decompiler for my program which decomposes the circuit into R and BS gates, while using the Xunitary compiler decomposes it into R and MZ gates. What compiler should I use for my program that shows exactly which gates are being implemented on the X8 machine physically? I am using the following code:

prog.compile(compiler=“Xunitary”)).print()

Alternatively I tried following the instructions in comments of Xunitary file.

The compiler may be used on its own:  
\>\>\> prog.compile(compiler=“Xunitary”)  
Alternatively, it can be combined with an X series device specification to include additional  
information, such as allowed parameter ranges.  
\>\>\> eng = sf.RemoteEngine(“X8”)  
\>\>\> spec = eng.device\_spec  
\>\>\> prog.compile(device=spec, compiler=“Xunitary”)

But it gives me an error:  
spec = eng.device\_spec  
AttributeError: ‘RemoteEngine’ object has no attribute ‘device\_spec’

Alternatively, where could I get more information on the gates and allowed parameter ranges for X8 machine? Thank you.

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [March 15, 2023, 3:46pm UTC](https://discuss.pennylane.ai/t/compiler-for-x8-01-machine/2711/2 "2023-03-15T15:46:37Z")

</div>

Hi @Aditya_Ranjan,

Thank you very much for your question.

Our tutorial on [executing programs on X8 devices](https://strawberryfields.ai/photonics/demos/tutorial_X8.html) can help answer some of your questions.

The error you’re getting seems to be in how you’re using your code.

The following should work  
`prog2 = prog.compile(device=eng.device, compiler="Xunitary")`

Does this work for you?

---

<div class="post-metadata">

**Author:** ![Aditya\_Ranjan](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/aditya_ranjan/32/1545_2.png) [@Aditya\_Ranjan](https://discuss.pennylane.ai/u/Aditya_Ranjan)\
**Post date:** [March 15, 2023, 7:53pm UTC](https://discuss.pennylane.ai/t/compiler-for-x8-01-machine/2711/3 "2023-03-15T19:53:20Z")

</div>

Hi @CatalinaAlbornoz ,

Yes, it works. Thank you so much for the reply.

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [March 16, 2023, 3:51pm UTC](https://discuss.pennylane.ai/t/compiler-for-x8-01-machine/2711/4 "2023-03-16T15:51:04Z")

</div>

That’s great to hear @Aditya_Ranjan !
