# Non-trivial conversions (Python to Julia)

Greetings Watchers,

of professionalism/community by attempting
to share your general thought process, feel
free to follow-up with me for clarification or
simply scroll/click along if you are neither
interested nor able to spend a little time
sharing your thoughts. Spare us the lectures
about MWEs, they are useful tools but not a
catchall especially for high-level or theoretical
questions. However, if you could provide one
that is instructive – it may benefit all.

I am attempting to convert two non-trivial
functions from Python to Julia:

``````qubovert.utils.qubo_to_quso
qubovert.utils.quso_to_qubo
``````

The first function replaces boolean
functions with spin variable inputs
(-1,1). The second function does the
opposite.

Are there any among you who might be
able to share your general thought or
process for converting these functions
from Python to Julia? Otherwise, if you
could point us to some resources that
explain the rudiments, this could benefit
all those watching.

Thanks,

Nah. I think this is a low effort question that doesn’t respect the time or efforts of the people on this forum answering questions, and it seems you’ve actually put less effort into your question than you put into trying to dissuade people like me from asking you to phrase your question in a more productive way.

While MWE’s are fantastic tools, you are right they’re not the only way to approach questions. However, putting no effort into even linking to the relevant package, or explaining what these functions do, and not demonstrating any effort on your part to understand how you could have done this yourself and then outlining where you ran into trouble, I think is a bad thing and posts like this should not be encouraged.

13 Likes

Write unit tests in Python, translate them to Julia, fix the issues they show in Julia. Just did that over Easter…

5 Likes

as I see - the python implementations is `quso_to_qubo`

@ufechner7 – This is exactly what I was looking for.
Such a simple answer, that allows me to build from the
rudiments. Thank you!

5 Likes

Thank you for your insights. I believe your
intention was to help. You will notice that
two high-level responses were provided
from those who seem more familiar with
the topic which were the guidelines I was
looking for – with no MWEs nonetheless.

It seems to me the user has been around for some time here and I’ll assume he has a very bad day. But this

is either a translation problem of a non native speaker or inappropriate (correct me if I’m wrong).

There might have been some communication issues, but I like the answer marked as solution, it also helps me to use an improved approach in the future.

3 Likes

@goerch – Not a translation or non-native English
speaker problem. The entire statement was directed
to @Eben60, the contributor who provided the fullest
solution/thought process without incident.

Yes – perhaps the other user, was a little upset about
something else. But I appreciated the time he spent
sharing his opinions.

I’m not a native speaker, but in my understanding your comment seems to dispute the abilities of readers of this group and this I don’t like very much.

@goerch – That was NOT my intention.
saying that I incorrectly heralded the
person who provided the most comprehensive
thought process.

Also, I do not know anyone who would reply to
my posts. My assumption is that those who
contribute can provide overarching direction,
a MWE (if appropriate), or ask for clarification.

1 Like

On a related issue, if you are interested in the reformulation of optimization problems into QUBO, you should check our package toQUBO.jl where we have implemented the transformation of binaries to spins and many more things. Feel free to leave any comments regarding your use case and we can talk about that more in depth. Moreover, if you want to contribute to it, we can always use more hand

1 Like

This was very helpful! I appreciate that you
were not deterred by the disclaimer.

Thank you – I will continue the
stream there. I actually reached
out to the members previously for
a closed issue.